Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
Lock is used to ensure only one agent has permission to do certain operations. It relies on creating files
func New ¶
New returns a Lock instance, it does not try to acquire the lock yet, so no file will be created until Acquire() is called.
func (*Lock) Acquire ¶
Acquire attempts to lock the file. This operation blocks as long as needed until it can be acquired.
func (*Lock) WithPeriod ¶
WithPeriod configures the polling period during lock acquisition, for purposes of printing the warning message.
Click to show internal directories.
Click to hide internal directories.