commands

package
v0.28.9 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: AGPL-3.0 Imports: 3 Imported by: 2 modules, 6 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

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 {

	// Handler method is the main method of an admin command. It is called only after a successful validation
	// by Validator method.
	// request parameter is the same object as passed to Validator method, so field ValidatorData can be used
	// to pass the validated parameters.
	// Any returned error will be returned to the caller with an error status code.
	// If no error is returned, the first return value is serialized and returned to a caller in an `Output` field.
	Handler(ctx context.Context, request *admin.CommandRequest) (interface{}, error)

	// Validator method is responsible for validating the input of a command, available in Data field of the request
	// argument.
	// Any error returned will abort the command execution and will be returned to the caller with InvalidArg error code
	// The same request object will be later passed to Handler method, so this method can set ValidatorData field with the
	// validated data needed to run the command
	Validator(request *admin.CommandRequest) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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