actions

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionManager

type ActionManager interface {
	Approve(actionID string) error
	Reject(actionID string) error
}

Action manager provides functionality to approve and reject an action given its id

func NewActionManager

func NewActionManager(core lib.SigningAgentClient, syncronizer ActionSyncronizer, log *zap.SugaredLogger, loadBalancingEnabled bool, messageCache message.CacheRemover) ActionManager

NewActionManager return an ActionManager that's an instance of actionManage

type ActionSyncronizer

type ActionSyncronizer interface {
	ShouldHandleAction(actionID string) bool
	AcquireLock() error
	Release(actionID string) error
}

ActionSyncronizer provides functionality to manage the approval of an action when load balancing is enabled

func NewSyncronizer

func NewSyncronizer(conf *config.LoadBalancing, cache store.KVStore, sync syncI) ActionSyncronizer

NewSyncronizer returns a new ActionSyncronizer that's an instance of syncronize

type MockActionSyncronizer

type MockActionSyncronizer struct {
	ShouldHandleActionCalled bool
	AcquireLockCalled        bool
	ReleaseCalled            bool
	LastActionId             string
	NextShouldHandle         bool
	NextLockError            error
	NextReleaseError         error
}

func (*MockActionSyncronizer) AcquireLock

func (m *MockActionSyncronizer) AcquireLock() error

func (*MockActionSyncronizer) Release

func (m *MockActionSyncronizer) Release(actionID string) error

func (*MockActionSyncronizer) ShouldHandleAction

func (m *MockActionSyncronizer) ShouldHandleAction(actionID string) bool

Jump to

Keyboard shortcuts

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