monitor

package
v0.52.2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	INITIAL_DELAY_DEFAULT  = 1 * time.Minute
	EXISTING_DELAY_DEFAULT = 45 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LostResourceUser

type LostResourceUser struct {
	C chan string // DRBD resource names of resources that may be promoted.
	// contains filtered or unexported fields
}

LostResourceUser is a struct that exposes the "may promote" state of a DRBD resource If a resource may be promoted (i.e., may be switched to Primary) after some grace period, this usually means that its user (that had the resource promoted) failed. It could also happen that the user just terminated/gets rescheduled,... It is up to the user of this API to decide. This also means that the user (e.g., some k8s pod) needs to be restarted/rescheduled. The LostResourceUser is generic, it sends the names of resources that lost their user on the channel C.

func NewLostResourceUser

func NewLostResourceUser(ctx context.Context, client *client.Client, options ...Option) (*LostResourceUser, error)

NewLostResourceUser creates a new LostResourceUser. It takes a context, a Go LINSTOR client, and options as its input.

func (*LostResourceUser) Stop

func (rl *LostResourceUser) Stop()

Stop terminates all helper Go routines and closes the connection to the events stream.

type Option

type Option func(*LostResourceUser) error

Option represents a configuration option of the LostResourceUser

func WithDelay

func WithDelay(initial, existing time.Duration) Option

WithDelay sets the "initial delay" (for not yet seen resources) and the "existing delay" (for already known resources).

Jump to

Keyboard shortcuts

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