Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadContext = errors.New("bad_context")
View Source
var ErrBadParam = errors.New("bad_param")
View Source
var ErrDuplicate = errors.New("duplicate")
View Source
var ErrNoLuck = errors.New("no_luck")
View Source
var ErrNotFound = errors.New("not_found")
View Source
var ErrNotSupported = errors.New("not_supported")
View Source
var ErrWrongState = errors.New("wrong_state")
Functions ¶
This section is empty.
Types ¶
type Lock ¶
type Lock struct { // Unique lock name Name string // Duration of lock in seconds (TTL) ExecutionDurationSec int // Interval between locks execution in seconds SpanDurationSec int // Additional lock check period CheckPeriodSec int }
func (*Lock) SetCheckPeriod ¶
type LockRecord ¶
type LockRecord struct { LockName string Version string DurationSec int State LockRecordState Dt time.Time }
func NewLockRecord ¶
func NewLockRecord( lock Lock, ) LockRecord
func (*LockRecord) ApplyPatch ¶
func (lr *LockRecord) ApplyPatch(patch LockRecordPatch)
type LockRecordPatch ¶
type LockRecordPatch struct { Version string DurationSec int State LockRecordState Dt time.Time }
func NewLockRecordPatchForCapture ¶
func NewLockRecordPatchForCapture( durationSec int, ) LockRecordPatch
func NewLockRecordPatchForRelease ¶
func NewLockRecordPatchForRelease(curVersion string) LockRecordPatch
type LockRecordState ¶
type LockRecordState string
const ( LockRecordStateNone LockRecordState = "" LockRecordStateLock LockRecordState = "lock" LockRecordStateUnlock LockRecordState = "unlock" )
func (LockRecordState) IsLock ¶
func (state LockRecordState) IsLock() bool
Click to show internal directories.
Click to hide internal directories.