leasechecker

package
v0.0.0-...-59d7cbf Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsReadOnly

func IsReadOnly() bool

func IsStateInitialized

func IsStateInitialized() bool

func ResetState

func ResetState()

ResetState resets the state of the lease checker. This is used for testing purposes only.

func RunStateCheck

func RunStateCheck(ctx context.Context, leaseStateChecker LeaseStateChecker)

Utility function to start DR checks. DR checks can be run either on the main go routine or a new go routine.

Types

type LeaseState

type LeaseState struct {
	ReadOnly           bool
	IsStateInitialized bool
}

type LeaseStateChecker

type LeaseStateChecker interface {
	RunStateCheck(ctx context.Context)
	ShouldRunOnIndependentGoRoutine() bool
	InitStateCache(interface{}) error
}

func GetStateChecker

func GetStateChecker(ctx context.Context, stateChecker string) LeaseStateChecker

Jump to

Keyboard shortcuts

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