splitted one operator module to file, account, image operators; splitted operator functions; etc
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2026 Oleg Borodin <onborodin@gmail.com>
|
||||
*
|
||||
* This work is published and licensed under a Creative Commons
|
||||
* Attribution-NonCommercial-NoDerivatives 4.0 International License.
|
||||
*
|
||||
* Distribution of this work is permitted, but commercial use and
|
||||
* modifications are strictly prohibited.
|
||||
*/
|
||||
package accoper
|
||||
|
||||
import (
|
||||
"mstore/app/locker"
|
||||
"mstore/app/logger"
|
||||
"mstore/app/maindb"
|
||||
"mstore/app/storage"
|
||||
)
|
||||
|
||||
type OperatorParams struct {
|
||||
MainDB *maindb.Database
|
||||
Store *storage.Storage
|
||||
}
|
||||
|
||||
type Operator struct {
|
||||
mdb *maindb.Database
|
||||
store *storage.Storage
|
||||
logg *logger.Logger
|
||||
iLock *locker.Locker
|
||||
fLock *locker.Locker
|
||||
}
|
||||
|
||||
func NewOperator(params *OperatorParams) (*Operator, error) {
|
||||
var err error
|
||||
oper := &Operator{
|
||||
mdb: params.MainDB,
|
||||
store: params.Store,
|
||||
}
|
||||
oper.iLock = locker.NewLocker()
|
||||
oper.fLock = locker.NewLocker()
|
||||
oper.logg = logger.NewLoggerWithSubject("imageoper")
|
||||
return oper, err
|
||||
}
|
||||
Reference in New Issue
Block a user