Documentation ¶
Overview ¶
Package inmemory implements an in-memory target locker. WARNING: since locking is done in memory, locally to the ConTest server, this will not prevent other ConTest servers to know that the target is in use.
Index ¶
- Variables
- func New(clk clock.Clock) target.Locker
- type InMemory
- func (tl *InMemory) Close() error
- func (tl *InMemory) Lock(ctx xcontext.Context, jobID types.JobID, duration time.Duration, ...) error
- func (tl *InMemory) RefreshLocks(ctx xcontext.Context, jobID types.JobID, duration time.Duration, ...) error
- func (tl *InMemory) TryLock(ctx xcontext.Context, jobID types.JobID, duration time.Duration, ...) ([]string, error)
- func (tl *InMemory) Unlock(ctx xcontext.Context, jobID types.JobID, targets []*target.Target) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Name = "InMemory"
Name is the name used to look this plugin up.
Functions ¶
Types ¶
type InMemory ¶
type InMemory struct {
// contains filtered or unexported fields
}
InMemory locks targets in an in-memory map.
func (*InMemory) Lock ¶
func (tl *InMemory) Lock(ctx xcontext.Context, jobID types.JobID, duration time.Duration, targets []*target.Target) error
Lock locks the specified targets.
func (*InMemory) RefreshLocks ¶
func (tl *InMemory) RefreshLocks(ctx xcontext.Context, jobID types.JobID, duration time.Duration, targets []*target.Target) error
RefreshLocks extends the lock duration by the internally configured timeout. If the owner is different, the request is rejected.
Click to show internal directories.
Click to hide internal directories.