handlers

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchVersion

func MatchVersion(possible []string, avail []string) string

Types

type ActionHandler

type ActionHandler interface {
	Handle(api.ActionSpec, common.Properties) (api.ActionResult, error)
}

type ActionHandlerMatch

type ActionHandlerMatch struct {
	Handler  ActionHandler
	Version  string
	Priority int
}

type ActionsProvider

type ActionsProvider interface {
	GetActions() Registry
}

type HandlerConfig

type HandlerConfig = registrations.HandlerConfig

type Option

type Option = api.Option

func ForAction

func ForAction(a string) Option

func ForSelectors

func ForSelectors(s ...api.Selector) Option

func WithPrio

func WithPrio(p int) Option

func WithVersions

func WithVersions(vers ...string) Option

type Options

type Options = api.Options

func NewOptions

func NewOptions(opts ...Option) *Options

type Registry

type Registry interface {
	registrations.HandlerRegistrationRegistry[Target, Option]

	GetActionTypes() api.ActionTypeRegistry

	Register(h ActionHandler, opts ...Option) error
	Execute(spec api.ActionSpec, creds common.Properties) (api.ActionResult, error)
	Get(spec api.ActionSpec, possible ...string) []ActionHandlerMatch
	AddTo(t Registry)
}

func DefaultRegistry

func DefaultRegistry() Registry

func NewRegistry

func NewRegistry(types api.ActionTypeRegistry, base ...Registry) Registry

type Target

type Target = ActionsProvider

Jump to

Keyboard shortcuts

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