action

package
v0.0.0-...-c345bb1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const Account3UUIDPlaceholder = "00000000-0000-0000-0000-000000000000"

Variables

This section is empty.

Functions

func Abort

func Abort(action AutomationAction, format string, v ...any)

func AuthenticateAccount3

func AuthenticateAccount3(ctx context.Context, config AuthenticationConfig, env *Environment) error

func First

func First[T models.Linkableable](wrapper interface{ GetItems() []T }, err error) (T, error)

func IsEqual

func IsEqualOrInverse

func IsEqualOrInverse(a AutomationAction, b AutomationAction) bool

func IsInverse

func IsInverse(a AutomationAction, b AutomationAction) bool

func KeyHubError

func KeyHubError(err error) error

func Koppeling

func Koppeling(linkable models.Linkableable) models.RestLinkable

func Ptr

func Ptr[T any](val T) *T

func Run

func Run(config AuthenticationConfig, action AutomationAction)

func Self

func Self(linkable models.Linkableable) models.RestLinkable

Types

type AuthenticatedAccount

type AuthenticatedAccount struct {
	Client  *keyhub.KeyHubClient
	Account models.AuthAccountable
}

type AuthenticationConfig

type AuthenticationConfig struct {
	Issuer                  string
	ClientID                string
	ClientSecret            string
	Scopes                  []string
	VaultRecoveryRecordUUID string
}

func NewAuthenticationConfig

func NewAuthenticationConfig(issuer string, clientID string, clientSecret string) AuthenticationConfig

type AutomationAction

type AutomationAction interface {
	TypeID() string
	Parameters() []*string
	Init(ctx context.Context, env *Environment)
	IsSatisfied() bool
	Requires3() bool
	AllowGlobalOptimization() bool
	Execute(ctx context.Context, env *Environment) error
	Setup(env *Environment) []AutomationAction
	Perform(env *Environment) []AutomationAction
	Revert() AutomationAction
	Progress() string
	fmt.Stringer
}

func Collect

func Collect(ctx context.Context, action AutomationAction, env *Environment, stepper Stepper) []AutomationAction

type Environment

type Environment struct {
	Account1         *AuthenticatedAccount
	Account2         *AuthenticatedAccount
	Account3         *AuthenticatedAccount
	VaultRecoveryKey string
}

func SetupEnvironment

func SetupEnvironment(ctx context.Context, config AuthenticationConfig) (*Environment, error)

type ProgressBarStepper

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

func (*ProgressBarStepper) AddSteps

func (s *ProgressBarStepper) AddSteps(num int64)

func (*ProgressBarStepper) Describe

func (s *ProgressBarStepper) Describe(text string)

func (*ProgressBarStepper) Done

func (s *ProgressBarStepper) Done()

func (*ProgressBarStepper) Step

func (s *ProgressBarStepper) Step()

type Stepper

type Stepper interface {
	Step()
	AddSteps(num int64)
	Done()
}

Jump to

Keyboard shortcuts

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