action

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DispatcherFunc

type DispatcherFunc func(ctx context.Context, payload Payload) error

DispatcherFunc is a function that will be dispatched to handle a payload.

type Manager

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

func NewManager

func NewManager(logger log.Logger) *Manager

NewManager creates an instance of Manager.

func (*Manager) Dispatch

func (m *Manager) Dispatch(ctx context.Context, actionPath string, payload Payload) error

Dispatch dispatches a payload to a path.

func (*Manager) Register

func (m *Manager) Register(actionPath string, actionFunc DispatcherFunc) error

Register registers a dispatcher function to an action path.

type NotFoundError

type NotFoundError struct {
	Path string
}

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type Payload

type Payload map[string]interface{}

Payload is an action payload.

func (Payload) Float64

func (p Payload) Float64(key string) (float64, error)

Float64 returns a float64 from the payload.

func (Payload) GroupVersionKind

func (p Payload) GroupVersionKind() (schema.GroupVersionKind, error)

GroupVersionKind extracts a GroupVersionKind from a payload.

func (Payload) String

func (p Payload) String(key string) (string, error)

String returns a string from the payload.

func (Payload) StringSlice

func (p Payload) StringSlice(key string) ([]string, error)

StringSlice returns a string slice from the payload.

Jump to

Keyboard shortcuts

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