api

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	KIND_ACTION     = "action"
	KIND_ACTIONTYPE = "action type"
)

Variables

This section is empty.

Functions

func EncodeActionResult

func EncodeActionResult(spec ActionResult, marshaler runtime.Marshaler) ([]byte, error)

func EncodeActionSpec

func EncodeActionSpec(spec ActionSpec, marshaler runtime.Marshaler) ([]byte, error)

func RegisterAction

func RegisterAction(name string, description string, usage string, attrs []string) error

func RegisterType

func RegisterType(typ ActionType) error

func SupportedActionVersions

func SupportedActionVersions(name string) []string

func Usage added in v0.18.0

func Usage(reg ActionTypeRegistry) string

Types

type Action

type Action interface {
	Name() string
	Description() string
	Usage() string
	ConsumerAttributes() []string
	GetVersion(string) ActionType
	SupportedVersions() []string
}

func GetAction

func GetAction(name string) Action

type ActionResult

type ActionResult interface {
	runtime.VersionedTypedObject
	SetVersion(string)
	SetType(string)
	GetMessage() string
}

func DecodeActionResult

func DecodeActionResult(data []byte, unmarshaler runtime.Unmarshaler) (ActionResult, error)

type ActionSpec

type ActionSpec interface {
	runtime.VersionedTypedObject
	SetVersion(string)
	Selector() Selector
	GetConsumerAttributes() common.Properties
}

func DecodeActionSpec

func DecodeActionSpec(data []byte, unmarshaler runtime.Unmarshaler) (ActionSpec, error)

type ActionType

type ActionType interface {
	runtime.VersionedTypedObject
	SpecificationType() ActionSpecType
	ResultType() ActionResultType
}

func NewActionType

func NewActionType[IS ActionSpec, IR ActionResult](kind, version string) ActionType

func NewActionTypeByConverter

func NewActionTypeByConverter[IS ActionSpec, VS runtime.TypedObject, IR ActionResult, VR runtime.TypedObject](kind, version string, specconv runtime.Converter[IS, VS], resconv runtime.Converter[IR, VR]) ActionType

type ActionTypeRegistry

type ActionTypeRegistry interface {
	RegisterAction(name string, description string, usage string, attrs []string) error
	RegisterActionType(typ ActionType) error

	DecodeActionSpec(data []byte, unmarshaler runtime.Unmarshaler) (ActionSpec, error)
	EncodeActionSpec(spec ActionSpec, marshaler runtime.Marshaler) ([]byte, error)

	DecodeActionResult(data []byte, unmarshaler runtime.Unmarshaler) (ActionResult, error)
	EncodeActionResult(spec ActionResult, marshaler runtime.Marshaler) ([]byte, error)

	GetActionNames() []string
	GetAction(name string) Action
	SupportedActionVersions(name string) []string

	Copy() ActionTypeRegistry
}

func DefaultRegistry

func DefaultRegistry() ActionTypeRegistry

func NewActionTypeRegistry

func NewActionTypeRegistry() ActionTypeRegistry

type CommonResult

type CommonResult struct {
	runtime.ObjectVersionedType `json:",inline"`
	Message                     string `json:"message,omitempty"`
}

CommonResult is the minimal action result.

func (*CommonResult) GetMessage

func (r *CommonResult) GetMessage() string

func (*CommonResult) SetType

func (r *CommonResult) SetType(typ string)

type Option

type Option interface {
	ApplyActionHandlerOptionTo(*Options)
}

type Options

type Options struct {
	Action    string
	Selectors []Selector
	Priority  int
	Versions  []string
}

func NewOptions

func NewOptions(olist ...Option) *Options

func (*Options) ApplyActionHandlerOptionTo

func (o *Options) ApplyActionHandlerOptionTo(opts *Options)

type Selector

type Selector string

func (Selector) ApplyActionHandlerOptionTo

func (s Selector) ApplyActionHandlerOptionTo(opts *Options)

Jump to

Keyboard shortcuts

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