root

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(authFn func(string) error) error

Authenticate performs authentication for the Root account in the command-line app

func MainLoop

func MainLoop(cmdMap map[string]*CmdConfig, onExit func())

MainLoop is the main REPL of the root application

func NewCommandMap

func NewCommandMap(cfgs ...*CmdConfig) map[string]*CmdConfig

NewCommandMap creates a new map of command to CmdConfigs

func ParamsMap

func ParamsMap(params []string, required []string, optional []string) (dict.Strings, error)

ParamsMap gets the key=value map from the parameters list

Types

type CmdConfig

type CmdConfig struct {
	Command   string
	MinParams int
	Docs      string
	Handler   CmdHandler
}

func NewCommand

func NewCommand(command string, minParams int, docs string, handler CmdHandler) *CmdConfig

NewCommand creates a new CmdConfig

type CmdHandler

type CmdHandler = func([]string)

CmdHandler takes in a list of string parameters

Jump to

Keyboard shortcuts

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