Documentation ¶
Index ¶
Constants ¶
View Source
const ( LINUX_DIR_PATH = "/var/lock/mist-miner" OBJECTS_LOCKFILE = "mm-objects.lock" HISTORY_LOCKFILE = "mm-history-logger.lock" HISTORY_POINTER_LOCKFILE = "mm-history-pointer.lock" REF_MARK_LOCKFILE = "mm-refmark.lock" )
Variables ¶
View Source
var ErrIsLocked = errors.New(
"File is locked, another process is writing to it, wait and try again later.",
)
Functions ¶
This section is empty.
Types ¶
type Lock ¶
func NewLock ¶
NewLock creates a new Lock object with the given group and filename. the lock file will be created in the appropriate directory based on the OS. Example of lock file path will be like: OS_DIR_PATH/GROUP/FILENAME If group is empty, the lock file will be created in the root directory. Example of lock file path will be like: OS_DIR_PATH/FILENAME
func (*Lock) TryLock ¶
TryLock acquires an exclusive lock on the file. Is a wrapper for flock.Lock().
Click to show internal directories.
Click to hide internal directories.