locker

package
v6.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAlreadyExists

func IsAlreadyExists(err error) bool

IsAlreadyExists asserts alreadyExistsError.

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

Types

type Interface

type Interface interface {
	Lock(ctx context.Context) error
	Unlock(ctx context.Context) error
}

Interface is some form of lock implementation like achieved for in process locking using sync.Mutex.

type KubeLockLocker

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

func NewKubeLockLocker

func NewKubeLockLocker(config KubeLockLockerConfig) (*KubeLockLocker, error)

func (KubeLockLocker) Lock

func (d KubeLockLocker) Lock(ctx context.Context) error

func (KubeLockLocker) Unlock

func (d KubeLockLocker) Unlock(ctx context.Context) error

type KubeLockLockerConfig

type KubeLockLockerConfig struct {
	Logger     micrologger.Logger
	RestConfig *rest.Config
}

type MutexLocker

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

MutexLocker implements Interface using sync.Mutex. For now we use a shared instance of *MutexLocker for all IPAM related activity of network packages in the legacy controllers and ipam resources in the clusterapi controllers.

func NewMutexLocker

func NewMutexLocker(config MutexLockerConfig) (*MutexLocker, error)

func (*MutexLocker) Lock

func (l *MutexLocker) Lock(ctx context.Context) error

func (*MutexLocker) Unlock

func (l *MutexLocker) Unlock(ctx context.Context) error

type MutexLockerConfig

type MutexLockerConfig struct {
	Logger micrologger.Logger
}

Jump to

Keyboard shortcuts

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