cmd

package
v0.33.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Name

func Name(name string) string

Types

type CommandArgs

type CommandArgs map[string]interface{}

func ParseCommandArgs

func ParseCommandArgs(arguments []json.RawMessage) CommandArgs

func (CommandArgs) GetBool

func (c CommandArgs) GetBool(variable string) (bool, bool)

func (CommandArgs) GetNumber

func (c CommandArgs) GetNumber(variable string) (float64, bool)

func (CommandArgs) GetString

func (c CommandArgs) GetString(variable string) (string, bool)

type Handler

type Handler func(context.Context, CommandArgs) (interface{}, error)

type Handlers

type Handlers map[string]Handler

func (Handlers) Get

func (h Handlers) Get(name, commandPrefix string) (Handler, bool)

func (Handlers) Names

func (h Handlers) Names(commandPrefix string) (names []string)

Jump to

Keyboard shortcuts

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