admin

package
v0.0.0-...-7f7efcf Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call(conn *connector.Conn, funcName string, flagSet *pflag.FlagSet, args []string) error

func Help

func Help(conn *connector.Conn, funcName string, flagSet *pflag.FlagSet, args []string) error

func List

func List(conn *connector.Conn, funcName string, flagSet *pflag.FlagSet, args []string) error

func Run

func Run(processAdminFunc ProcessAdminFuncType, ctx *context.Ctx, funcName string, flagSet *pflag.FlagSet, args []string) error

Types

type ArgSpec

type ArgSpec struct {
	Usage string
	Type  string
}

type ArgsSpec

type ArgsSpec map[string]ArgSpec

type FuncCallArg

type FuncCallArg struct {
	Name string
	Type string

	StringValue string
	NumberValue float64
	BoolValue   bool

	// Changed is an equivalent for pflag.Flag.Changed
	// It's true when user entered argument value
	// If this value is false, argument isn't passed to function
	// (in fact, opt.<arg-name> is nil)
	Changed bool
}

type FuncInfo

type FuncInfo struct {
	Name  string
	Usage string
	Args  ArgsSpec
}

func (*FuncInfo) DecodeMsgpack

func (funcInfo *FuncInfo) DecodeMsgpack(d *msgpack.Decoder) error

func (*FuncInfo) Format

func (funcInfo *FuncInfo) Format() string

type FuncInfos

type FuncInfos map[string]FuncInfo

func (*FuncInfos) FormatUsages

func (funcInfos *FuncInfos) FormatUsages() string

type ProcessAdminFuncType

type ProcessAdminFuncType func(conn *connector.Conn, funcName string, flagSet *pflag.FlagSet, args []string) error

Jump to

Keyboard shortcuts

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