locker

package
v0.0.0-...-b197db6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Locked = exit.Error{
	Message:  "instance is locked for administrative operations",
	ExitCode: exit.ExitGeneric,
}

Functions

This section is empty.

Types

type Locker

type Locker struct {
	ingredient.Base
}

Locker provides facitilites for locking this WissKI instance

func (*Locker) Fetch

func (locker *Locker) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) (err error)

func (*Locker) Locked

func (lock *Locker) Locked(ctx context.Context) (locked bool)

Locked checks if this WissKI is currently locked. If an error occurs, the instance is considered not locked.

func (*Locker) TryLock

func (lock *Locker) TryLock(ctx context.Context) bool

TryLock attemps to lock this WissKI and returns if it suceeded

func (*Locker) TryUnlock

func (lock *Locker) TryUnlock(ctx context.Context) bool

TryUnlock attempts to unlock this WissKI and reports if it succeeded. An Unlock is also attempted when ctx is cancelled.

func (*Locker) Unlock

func (lock *Locker) Unlock(ctx context.Context)

Unlock unlocks this WissKI, ignoring any error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL