executors

package
v1.0.4-alpha4 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBLSKeysExecutor

func NewBLSKeysExecutor(args ArgsBLSKeysExecutor) (*blsKeysExecutor, error)

NewBLSKeysExecutor creates a new instance of type blsKeysExecutor

func NewBLSKeysTimeCache added in v1.0.3

func NewBLSKeysTimeCache(args ArgsBlsKeysTimeCache) (*blsKeysTimeCache, error)

NewBLSKeysTimeCache creates a new instance of type BLS keys time cache

func NewNotifiersHandler

func NewNotifiersHandler(args ArgsNotifiersHandler) (*notifiersHandler, error)

NewNotifiersHandler creates a new instance of type notifiersHandler

func NewStatusHandler

func NewStatusHandler(name string, notifiersHandler OutputNotifiersHandler) (*statusHandler, error)

NewStatusHandler creates a new instance of type statusHandler

func NewStatusHandlerTrigger

func NewStatusHandlerTrigger(args ArgsStatusHandlerTrigger) (*statusHandlerTrigger, error)

NewStatusHandlerTrigger will create a new instance of type statusHandlerTrigger

Types

type ArgsBLSKeysExecutor

type ArgsBLSKeysExecutor struct {
	OutputNotifiersHandler     OutputNotifiersHandler
	RatingsChecker             RatingsChecker
	ValidatorStatisticsQuerier ValidatorStatisticsQuerier
	BlsKeysFetcher             BLSKeysFetcher
	StatusHandler              StatusHandler
	BLSKeysFilter              BLSKeysFilter
	Name                       string
	ExplorerURL                string
}

ArgsBLSKeysExecutor defines the DTO struct for the NewBLSKeysExecutor constructor function

type ArgsBlsKeysTimeCache added in v1.0.3

type ArgsBlsKeysTimeCache struct {
	MaxSnoozeEvents     uint32
	CacheExpiration     uint64
	GetCurrentTimestamp func() int64
}

ArgsBlsKeysTimeCache is the argument DTO used for the NewBLSKeysTimeCache constructor function

type ArgsNotifiersHandler

type ArgsNotifiersHandler struct {
	Notifiers          []OutputNotifier
	NumRetries         uint32
	TimeBetweenRetries time.Duration
}

ArgsNotifiersHandler defines the DTO struct for the NewNotifiersHandler constructor function

type ArgsStatusHandlerTrigger

type ArgsStatusHandlerTrigger struct {
	TimeFunc      func() time.Time
	Executor      Executor
	TriggerDay    time.Weekday
	TriggerHour   int
	TriggerMinute int
}

ArgsStatusHandlerTrigger represents the DTO used in the NewStatusHandlerTrigger constructor function

type BLSKeysFetcher

type BLSKeysFetcher interface {
	GetAllBLSKeys(ctx context.Context, sender string) ([]string, error)
	IsInterfaceNil() bool
}

BLSKeysFetcher is able to get all staked BLS keys of an identity

type BLSKeysFilter added in v1.0.3

type BLSKeysFilter interface {
	ShouldNotify(blsKey string) bool
	IsInterfaceNil() bool
}

BLSKeysFilter is able to decide if a provided BLS key needs to be filtered out or not

type Executor

type Executor interface {
	Execute(ctx context.Context) error
	IsInterfaceNil() bool
}

Executor defines the behavior of a component able to execute a certain task

type OutputNotifier

type OutputNotifier interface {
	OutputMessages(messages ...core.OutputMessage) error
	Name() string
	IsInterfaceNil() bool
}

OutputNotifier defines the operations supported by an output notifier instance

type OutputNotifiersHandler

type OutputNotifiersHandler interface {
	NotifyWithRetry(caller string, messages ...core.OutputMessage) error
	IsInterfaceNil() bool
}

OutputNotifiersHandler defines the behavior of a component that is able to notify all notifiers

type RatingsChecker

type RatingsChecker interface {
	Check(statistics map[string]*core.ValidatorStatistics, extraBLSKeys []string) ([]core.CheckResponse, error)
	IsInterfaceNil() bool
}

RatingsChecker defines the operation of a component able to check the ratings

type StatusHandler

type StatusHandler interface {
	NotifyAppStart()
	ErrorEncountered(err error)
	CollectKeysProblems(messages []core.OutputMessage)
	Execute(ctx context.Context) error
	SendCloseMessage()
	IsInterfaceNil() bool
}

StatusHandler defines the operations of a component able to keep the status of the app

type ValidatorStatisticsQuerier

type ValidatorStatisticsQuerier interface {
	Query(ctx context.Context) (map[string]*core.ValidatorStatistics, error)
	IsInterfaceNil() bool
}

ValidatorStatisticsQuerier defines the operations of a component able to query the validators statistics

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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