Documentation
¶
Index ¶
- Constants
- type Args
- type Command
- func (self Command) Run(args ...string) error
- func (self Command) String() string
- func (self Command) WithCommand(cmd Command) Command
- func (self Command) WithDescription(description string) Command
- func (self Command) WithDisabled(disabled bool) Command
- func (self Command) WithHandler(handler func(args Args) error) Command
- func (self Command) WithParams(params Params) Command
- type Param
- type Params
- type Primitive
- type StringParam
- func (self StringParam) Coerce(value string) (any, error)
- func (self StringParam) Description(description string) StringParam
- func (self StringParam) GetDescription() string
- func (self StringParam) IsRequired() bool
- func (self StringParam) MarshalJSON() ([]byte, error)
- func (self StringParam) MaxLength(maxLength int) StringParam
- func (self StringParam) MinLength(minLength int) StringParam
- func (self StringParam) Required() StringParam
- func (self StringParam) String() string
- func (self StringParam) Type() Primitive
- func (self *StringParam) UnmarshalJSON(b []byte) error
- func (self StringParam) Validate(value string) error
- type Text
- func (self Text) BlackBackground() Text
- func (self Text) BlackForeground() Text
- func (self Text) Blink() Text
- func (self Text) BlueBackground() Text
- func (self Text) BlueForeground(text string) Text
- func (self Text) Bold() Text
- func (self Text) CyanBackground() Text
- func (self Text) CyanForeground() Text
- func (self Text) DefaultBackground() Text
- func (self Text) DefaultForeground() Text
- func (self Text) Dim() Text
- func (self Text) EraseLine() Text
- func (self Text) EraseLineEnd() Text
- func (self Text) EraseLineStart() Text
- func (self Text) EraseScreen() Text
- func (self Text) EraseScreenEnd() Text
- func (self Text) EraseScreenStart() Text
- func (self Text) GreenBackground() Text
- func (self Text) GreenForeground() Text
- func (self Text) Hide() Text
- func (self Text) Italic() Text
- func (self Text) MagentaBackground() Text
- func (self Text) MagentaForeground() Text
- func (self Text) PadLeft(n int) Text
- func (self Text) PadRight(n int) Text
- func (self Text) RedBackground() Text
- func (self Text) RedForeground() Text
- func (self Text) Reverse() Text
- func (self Text) Strike() Text
- func (self Text) String() string
- func (self Text) Underline() Text
- func (self Text) WhiteBackground() Text
- func (self Text) WhiteForeground() Text
- func (self Text) YellowBackground() Text
- func (self Text) YellowForeground() Text
Constants ¶
View Source
const ( ANSI_CODE_RESET string = "\x1b[0m" ANSI_CODE_BOLD string = "\x1b[1m" ANSI_CODE_BOLD_RESET string = "\x1b[22m" ANSI_CODE_DIM string = "\x1b[2m" ANSI_CODE_DIM_RESET string = "\x1b[22m" ANSI_CODE_ITALIC string = "\x1b[3m" ANSI_CODE_ITALIC_RESET string = "\x1b[23m" ANSI_CODE_UNDERLINE string = "\x1b[4m" ANSI_CODE_UNDERLINE_RESET string = "\x1b[24m" ANSI_CODE_BLINK string = "\x1b[5m" ANSI_CODE_BLINK_RESET string = "\x1b[25m" ANSI_CODE_REVERSE string = "\x1b[7m" ANSI_CODE_REVERSE_RESET string = "\x1b[27m" ANSI_CODE_HIDE string = "\x1b[8m" ANSI_CODE_HIDE_RESET string = "\x1b[28m" ANSI_CODE_STRIKE string = "\x1b[9m" ANSI_CODE_STRIKE_RESET string = "\x1b[29m" ANSI_CODE_FOREGROUND_RESET string = "\x1b[0m" ANSI_CODE_BACKGROUND_RESET string = "\x1b[0m" ANSI_CODE_FOREGROUND_BLACK string = "\x1b[30m" ANSI_CODE_BACKGROUND_BLACK string = "\x1b[40m" ANSI_CODE_FOREGROUND_RED string = "\x1b[31m" ANSI_CODE_BACKGROUND_RED string = "\x1b[41m" ANSI_CODE_FOREGROUND_GREEN string = "\x1b[32m" ANSI_CODE_BACKGROUND_GREEN string = "\x1b[42m" ANSI_CODE_FOREGROUND_YELLOW string = "\x1b[33m" ANSI_CODE_BACKGROUND_YELLOW string = "\x1b[43m" ANSI_CODE_FOREGROUND_BLUE string = "\x1b[34m" ANSI_CODE_BACKGROUND_BLUE string = "\x1b[44m" ANSI_CODE_FOREGROUND_MAGENTA string = "\x1b[35m" ANSI_CODE_BACKGROUND_MAGENTA string = "\x1b[45m" ANSI_CODE_FOREGROUND_CYAN string = "\x1b[36m" ANSI_CODE_BACKGROUND_CYAN string = "\x1b[46m" ANSI_CODE_FOREGROUND_WHITE string = "\x1b[37m" ANSI_CODE_BACKGROUND_WHITE string = "\x1b[47m" ANSI_CODE_FOREGROUND_DEFAULT string = "\x1b[39m" ANSI_CODE_BACKGROUND_DEFAULT string = "\x1b[49m" ANSI_CODE_ERASE_SCREEN_END string = "\x1b[0Jm" ANSI_CODE_ERASE_SCREEN_START string = "\x1b[1Jm" ANSI_CODE_ERASE_SCREEN string = "\x1b[2Jm" ANSI_CODE_ERASE_LINE_END string = "\x1b[0K" ANSI_CODE_ERASE_LINE_START string = "\x1b[1K" ANSI_CODE_ERASE_LINE string = "\x1b[2K" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Args ¶
func (Args) MarshalJSON ¶
type Command ¶
type Command struct {
Name string `json:"name"`
Description string `json:"description"`
Params Params `json:"params"`
Disabled bool `json:"disabled"`
Commands []Command `json:"commands"`
Handler func(args Args) error `json:"-"`
}
func NewCommand ¶
func (Command) WithCommand ¶
func (Command) WithDescription ¶
func (Command) WithDisabled ¶
func (Command) WithParams ¶
type StringParam ¶
type StringParam struct {
// contains filtered or unexported fields
}
func String ¶
func String() StringParam
func (StringParam) Description ¶
func (self StringParam) Description(description string) StringParam
func (StringParam) GetDescription ¶
func (self StringParam) GetDescription() string
func (StringParam) IsRequired ¶
func (self StringParam) IsRequired() bool
func (StringParam) MarshalJSON ¶
func (self StringParam) MarshalJSON() ([]byte, error)
func (StringParam) MaxLength ¶
func (self StringParam) MaxLength(maxLength int) StringParam
func (StringParam) MinLength ¶
func (self StringParam) MinLength(minLength int) StringParam
func (StringParam) Required ¶
func (self StringParam) Required() StringParam
func (StringParam) String ¶
func (self StringParam) String() string
func (StringParam) Type ¶
func (self StringParam) Type() Primitive
func (*StringParam) UnmarshalJSON ¶
func (self *StringParam) UnmarshalJSON(b []byte) error
func (StringParam) Validate ¶
func (self StringParam) Validate(value string) error
type Text ¶
type Text string
func (Text) BlackBackground ¶
func (Text) BlackForeground ¶
func (Text) BlueBackground ¶
func (Text) BlueForeground ¶
func (Text) CyanBackground ¶
func (Text) CyanForeground ¶
func (Text) DefaultBackground ¶
func (Text) DefaultForeground ¶
func (Text) EraseLineEnd ¶
func (Text) EraseLineStart ¶
func (Text) EraseScreen ¶
func (Text) EraseScreenEnd ¶
func (Text) EraseScreenStart ¶
func (Text) GreenBackground ¶
func (Text) GreenForeground ¶
func (Text) MagentaBackground ¶
func (Text) MagentaForeground ¶
func (Text) RedBackground ¶
func (Text) RedForeground ¶
func (Text) WhiteBackground ¶
func (Text) WhiteForeground ¶
func (Text) YellowBackground ¶
func (Text) YellowForeground ¶
Click to show internal directories.
Click to hide internal directories.