storage

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEtcdPageSize      = 5000 // Maximum locations (xnames) and task results to store in each etcd entry
	DefaultMaxMessageLen     = 130  // Maximum length of Task messages and errors when over all object is too large
	DefaultMaxEtcdObjectSize = 1570000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DistributedLockProvider

type DistributedLockProvider interface {
	Init(Logger *logrus.Logger) error
	InitFromStorage(si interface{}, Logger *logrus.Logger)
	Ping() error
	GetDuration() time.Duration
	DistributedTimedLock(maxLockTime time.Duration) error
	Unlock() error
}

type ETCDLockProvider

type ETCDLockProvider struct {
	Logger   *logrus.Logger
	Duration time.Duration
	// contains filtered or unexported fields
}

func (*ETCDLockProvider) DistributedTimedLock

func (d *ETCDLockProvider) DistributedTimedLock(maxLockTime time.Duration) error

func (*ETCDLockProvider) GetDuration

func (d *ETCDLockProvider) GetDuration() time.Duration

func (*ETCDLockProvider) Init

func (e *ETCDLockProvider) Init(Logger *logrus.Logger) error

func (*ETCDLockProvider) InitFromStorage

func (d *ETCDLockProvider) InitFromStorage(m interface{}, Logger *logrus.Logger)

func (*ETCDLockProvider) Ping

func (d *ETCDLockProvider) Ping() error

func (*ETCDLockProvider) Unlock

func (d *ETCDLockProvider) Unlock() error

type ETCDStorage

type ETCDStorage struct {
	Logger            *logrus.Logger
	DisableSizeChecks bool
	PageSize          int
	MaxMessageLen     int
	MaxEtcdObjectSize int
	// contains filtered or unexported fields
}

func (*ETCDStorage) DeletePowerCapOperation

func (e *ETCDStorage) DeletePowerCapOperation(taskID uuid.UUID, opID uuid.UUID) error

func (*ETCDStorage) DeletePowerCapTask

func (e *ETCDStorage) DeletePowerCapTask(taskID uuid.UUID) error

func (*ETCDStorage) DeletePowerStatus

func (e *ETCDStorage) DeletePowerStatus(xname string) error

func (*ETCDStorage) DeleteTransition

func (e *ETCDStorage) DeleteTransition(transitionID uuid.UUID) error

func (*ETCDStorage) DeleteTransitionTask

func (e *ETCDStorage) DeleteTransitionTask(transitionID uuid.UUID, taskID uuid.UUID) error

func (*ETCDStorage) GetAllPowerCapOperationsForTask

func (e *ETCDStorage) GetAllPowerCapOperationsForTask(taskID uuid.UUID) ([]model.PowerCapOperation, error)

func (*ETCDStorage) GetAllPowerCapTasks

func (e *ETCDStorage) GetAllPowerCapTasks() ([]model.PowerCapTask, error)

func (*ETCDStorage) GetAllPowerStatus

func (e *ETCDStorage) GetAllPowerStatus() (model.PowerStatus, error)

func (*ETCDStorage) GetAllTasksForTransition

func (e *ETCDStorage) GetAllTasksForTransition(transitionID uuid.UUID) ([]model.TransitionTask, error)

func (*ETCDStorage) GetAllTransitions

func (e *ETCDStorage) GetAllTransitions() ([]model.Transition, error)

func (*ETCDStorage) GetPowerCapOperation

func (e *ETCDStorage) GetPowerCapOperation(taskID, opID uuid.UUID) (model.PowerCapOperation, error)

func (*ETCDStorage) GetPowerCapTask

func (e *ETCDStorage) GetPowerCapTask(taskID uuid.UUID) (model.PowerCapTask, error)

func (*ETCDStorage) GetPowerStatus

func (e *ETCDStorage) GetPowerStatus(xname string) (model.PowerStatusComponent, error)

func (*ETCDStorage) GetPowerStatusHierarchy

func (e *ETCDStorage) GetPowerStatusHierarchy(xname string) (model.PowerStatus, error)

func (*ETCDStorage) GetPowerStatusMaster

func (e *ETCDStorage) GetPowerStatusMaster() (time.Time, error)

func (*ETCDStorage) GetTransition

func (e *ETCDStorage) GetTransition(transitionID uuid.UUID) (transition model.Transition, transitionFirstPage model.Transition, err error)

func (*ETCDStorage) GetTransitionPages

func (e *ETCDStorage) GetTransitionPages(transitionId string) ([]model.TransitionPage, error)

func (*ETCDStorage) GetTransitionTask

func (e *ETCDStorage) GetTransitionTask(transitionID, taskID uuid.UUID) (model.TransitionTask, error)

func (*ETCDStorage) Init

func (e *ETCDStorage) Init(Logger *logrus.Logger) error

func (*ETCDStorage) Ping

func (e *ETCDStorage) Ping() error

func (*ETCDStorage) StorePowerCapOperation

func (e *ETCDStorage) StorePowerCapOperation(op model.PowerCapOperation) error

func (*ETCDStorage) StorePowerCapTask

func (e *ETCDStorage) StorePowerCapTask(task model.PowerCapTask) error

func (*ETCDStorage) StorePowerStatus

func (e *ETCDStorage) StorePowerStatus(p model.PowerStatusComponent) error

func (*ETCDStorage) StorePowerStatusMaster

func (e *ETCDStorage) StorePowerStatusMaster(now time.Time) error

func (*ETCDStorage) StoreTransition

func (e *ETCDStorage) StoreTransition(transition model.Transition) error

func (*ETCDStorage) StoreTransitionTask

func (e *ETCDStorage) StoreTransitionTask(task model.TransitionTask) error

func (*ETCDStorage) TASPowerStatusMaster

func (e *ETCDStorage) TASPowerStatusMaster(now time.Time, testVal time.Time) (bool, error)

func (*ETCDStorage) TASTransition

func (e *ETCDStorage) TASTransition(transition model.Transition, testVal model.Transition) (bool, error)

type MEMLockProvider

type MEMLockProvider struct {
	Logger   *logrus.Logger
	Duration time.Duration
	// contains filtered or unexported fields
}

func (*MEMLockProvider) DistributedTimedLock

func (d *MEMLockProvider) DistributedTimedLock(maxLockTime time.Duration) error

func (*MEMLockProvider) GetDuration

func (d *MEMLockProvider) GetDuration() time.Duration

func (*MEMLockProvider) Init

func (d *MEMLockProvider) Init(Logger *logrus.Logger) error

func (*MEMLockProvider) InitFromStorage

func (d *MEMLockProvider) InitFromStorage(m interface{}, Logger *logrus.Logger)

func (*MEMLockProvider) Ping

func (d *MEMLockProvider) Ping() error

func (*MEMLockProvider) Unlock

func (d *MEMLockProvider) Unlock() error

type MEMStorage

type MEMStorage struct {
	Logger            *logrus.Logger
	DisableSizeChecks bool
	PageSize          int
	MaxMessageLen     int
	MaxEtcdObjectSize int
	// contains filtered or unexported fields
}

func (*MEMStorage) DeletePowerCapOperation

func (m *MEMStorage) DeletePowerCapOperation(taskID uuid.UUID, opID uuid.UUID) error

func (*MEMStorage) DeletePowerCapTask

func (m *MEMStorage) DeletePowerCapTask(taskID uuid.UUID) error

func (*MEMStorage) DeletePowerStatus

func (m *MEMStorage) DeletePowerStatus(xname string) error

func (*MEMStorage) DeleteTransition

func (m *MEMStorage) DeleteTransition(transitionID uuid.UUID) error

func (*MEMStorage) DeleteTransitionTask

func (m *MEMStorage) DeleteTransitionTask(transitionID uuid.UUID, taskID uuid.UUID) error

func (*MEMStorage) GetAllPowerCapOperationsForTask

func (m *MEMStorage) GetAllPowerCapOperationsForTask(taskID uuid.UUID) ([]model.PowerCapOperation, error)

func (*MEMStorage) GetAllPowerCapTasks

func (m *MEMStorage) GetAllPowerCapTasks() ([]model.PowerCapTask, error)

func (*MEMStorage) GetAllPowerStatus

func (m *MEMStorage) GetAllPowerStatus() (model.PowerStatus, error)

func (*MEMStorage) GetAllTasksForTransition

func (m *MEMStorage) GetAllTasksForTransition(transitionID uuid.UUID) ([]model.TransitionTask, error)

func (*MEMStorage) GetAllTransitions

func (m *MEMStorage) GetAllTransitions() ([]model.Transition, error)

func (*MEMStorage) GetPowerCapOperation

func (m *MEMStorage) GetPowerCapOperation(taskID uuid.UUID, opID uuid.UUID) (model.PowerCapOperation, error)

func (*MEMStorage) GetPowerCapTask

func (m *MEMStorage) GetPowerCapTask(taskID uuid.UUID) (model.PowerCapTask, error)

func (*MEMStorage) GetPowerStatus

func (m *MEMStorage) GetPowerStatus(xname string) (model.PowerStatusComponent, error)

func (*MEMStorage) GetPowerStatusHierarchy

func (m *MEMStorage) GetPowerStatusHierarchy(xname string) (model.PowerStatus, error)

func (*MEMStorage) GetPowerStatusMaster

func (m *MEMStorage) GetPowerStatusMaster() (time.Time, error)

func (*MEMStorage) GetTransition

func (m *MEMStorage) GetTransition(transitionID uuid.UUID) (transition model.Transition, transitionFirstPage model.Transition, err error)

func (*MEMStorage) GetTransitionTask

func (m *MEMStorage) GetTransitionTask(transitionID uuid.UUID, taskID uuid.UUID) (model.TransitionTask, error)

func (*MEMStorage) Init

func (m *MEMStorage) Init(Logger *logrus.Logger) error

func (*MEMStorage) Ping

func (m *MEMStorage) Ping() error

func (*MEMStorage) StorePowerCapOperation

func (m *MEMStorage) StorePowerCapOperation(op model.PowerCapOperation) error

func (*MEMStorage) StorePowerCapTask

func (m *MEMStorage) StorePowerCapTask(task model.PowerCapTask) error

func (*MEMStorage) StorePowerStatus

func (m *MEMStorage) StorePowerStatus(p model.PowerStatusComponent) error

func (*MEMStorage) StorePowerStatusMaster

func (m *MEMStorage) StorePowerStatusMaster(now time.Time) error

func (*MEMStorage) StoreTransition

func (m *MEMStorage) StoreTransition(transition model.Transition) error

func (*MEMStorage) StoreTransitionTask

func (m *MEMStorage) StoreTransitionTask(op model.TransitionTask) error

func (*MEMStorage) TASPowerStatusMaster

func (m *MEMStorage) TASPowerStatusMaster(now time.Time, testVal time.Time) (bool, error)

func (*MEMStorage) TASTransition

func (m *MEMStorage) TASTransition(transition model.Transition, testVal model.Transition) (bool, error)

type StorageProvider

type StorageProvider interface {
	Init(Logger *logrus.Logger) error
	Ping() error

	GetPowerStatusMaster() (time.Time, error)
	StorePowerStatusMaster(now time.Time) error
	TASPowerStatusMaster(now time.Time, testVal time.Time) (bool, error)
	StorePowerStatus(p model.PowerStatusComponent) error
	DeletePowerStatus(xname string) error
	GetPowerStatus(xname string) (model.PowerStatusComponent, error)
	GetAllPowerStatus() (model.PowerStatus, error)
	GetPowerStatusHierarchy(xname string) (model.PowerStatus, error)

	StorePowerCapTask(task model.PowerCapTask) error
	StorePowerCapOperation(op model.PowerCapOperation) error
	GetPowerCapTask(taskID uuid.UUID) (model.PowerCapTask, error)
	GetPowerCapOperation(taskID uuid.UUID, opID uuid.UUID) (model.PowerCapOperation, error)
	GetAllPowerCapOperationsForTask(taskID uuid.UUID) ([]model.PowerCapOperation, error)
	GetAllPowerCapTasks() ([]model.PowerCapTask, error)
	DeletePowerCapTask(taskID uuid.UUID) error
	DeletePowerCapOperation(taskID uuid.UUID, opID uuid.UUID) error

	StoreTransition(transition model.Transition) error
	StoreTransitionTask(task model.TransitionTask) error
	GetTransition(transitionID uuid.UUID) (transition model.Transition, transtiionFirstPage model.Transition, err error)
	GetTransitionTask(transitionID uuid.UUID, taskID uuid.UUID) (model.TransitionTask, error)
	GetAllTasksForTransition(transitionID uuid.UUID) ([]model.TransitionTask, error)
	GetAllTransitions() ([]model.Transition, error)
	DeleteTransition(transitionID uuid.UUID) error
	DeleteTransitionTask(transitionID uuid.UUID, taskID uuid.UUID) error
	TASTransition(transition model.Transition, testVal model.Transition) (bool, error)
}

type TransitionWatchCBFunc

type TransitionWatchCBFunc func(Transition model.Transition, wasDeleted bool, err error, userdata interface{}) bool

type WatchTransitionCBHandle

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

Jump to

Keyboard shortcuts

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