/*
 * Copyright 2026 Oleg Borodin <onborodin@gmail.com>
 */
package fileoper

import (
	"mstore/app/locker"
	"mstore/app/logger"
	"mstore/app/maindb"
	"mstore/app/storage"
)

type OperatorParams struct {
	MainDB   *maindb.Database
	Store    *storage.Storage
	Hostname string
}

type Operator struct {
	mdb      *maindb.Database
	store    *storage.Storage
	logg     *logger.Logger
	iLock    *locker.Locker
	hostname string
}

func NewOperator(params *OperatorParams) (*Operator, error) {
	var err error
	oper := &Operator{
		mdb:      params.MainDB,
		store:    params.Store,
		hostname: params.Hostname,
	}
	oper.iLock = locker.NewLocker()
	oper.logg = logger.NewLoggerWithSubject("fileoper")
	return oper, err
}
