clusterlock

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// default namespace to install
	LockDefaultNamespace = "default"
	// name of kubernetes service holding the lock
	LockResourceName = "test-lock"
	// name of the annotation containing the lock
	LockAnnotationKey = "test.lock"
	// name of the annotation containing the timeout
	LockTimeoutAnnotationKey = "test.lock.timeout"

	// Default timeout for lock to be held
	DefaultLockTimeout = time.Second * 30
	DefaultTimeFormat  = time.RFC3339Nano

	// heartbeat settings
	DefaultHeartbeatTime = time.Second * 10
)

Variables

View Source
var (
	IsEmptyLockReleaseError = func(e error) bool {
		return e == emptyLockReleaseError
	}

	IsNotLockOwnerError = func(e error) bool {
		return e == notLockOwnerError
	}

	IsLockIsUseError = func(e error) bool {
		return e == lockInUseError
	}
)

Functions

This section is empty.

Types

type Options

type Options struct {
	Namespace string
	IdPrefix  string
	Context   context.Context
}

type TestClusterLocker

type TestClusterLocker struct {
	// contains filtered or unexported fields
}

func NewTestClusterLocker

func NewTestClusterLocker(clientset kubernetes.Interface, options Options) (*TestClusterLocker, error)

func (*TestClusterLocker) AcquireLock

func (t *TestClusterLocker) AcquireLock(opts ...retry.Option) error

func (*TestClusterLocker) ReleaseLock

func (t *TestClusterLocker) ReleaseLock() error

Jump to

Keyboard shortcuts

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