commands

package
v0.28.13 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: AGPL-3.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToInterfaceList added in v0.24.5

func ConvertToInterfaceList(list interface{}) ([]interface{}, error)

func ConvertToMap added in v0.24.5

func ConvertToMap(object interface{}) (map[string]interface{}, error)

Types

type AdminCommand

type AdminCommand interface {
	// Validator is responsible for validating that the input forms a valid request.
	// By convention, Validator may set the ValidatorData field on the request, and
	// this will persist when the request is passed to Handler.
	// All errors indicate an invalid request.
	// TODO define sentinel error type for expected errors
	Validator(request *admin.CommandRequest) error
	// Handler is responsible for handling the request. It applies any state
	// changes associated with the request and returns any values which should
	// be displayed to the initiator of the request.
	// All errors indicate an invalid request, or benign failure to satisfy the request.
	// TODO define sentinel error type for expected errors
	Handler(ctx context.Context, request *admin.CommandRequest) (interface{}, error)
}

AdminCommand defines the interface expected for admin command handlers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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