core

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownCmd = errors.New("unknown command")

Functions

func CombineArgs added in v0.5.1

func CombineArgs(args []string) string

CombineArgs The input parameter is an array of string ([]string), and the function combines the array elements into a string. Each element string should be enclosed in a pair of double quotes, and the elements are separated by spaces. In particular, if the string content of the array element contains double quotes, then the double quotes should be replaced with the escape character "\"".

func GetCompleter

func GetCompleter(cmd *Cmd) func(d prompt.Document) []prompt.Suggest

func GetExecutor

func GetExecutor(cmd *Cmd) func(s string)

func ParseCmd

func ParseCmd(input string) (string, []string)

func ParseCmd4Cli added in v0.5.1

func ParseCmd4Cli(cmd []string) (name string, options []string)

ParseCmd4Cli zk command parsing, cli simplified version

Types

type Auth

type Auth struct {
	Scheme  string
	Payload []byte
}

func NewAuth

func NewAuth(scheme, auth string) *Auth

type Cmd

type Cmd struct {
	Name        string
	Options     []string
	ExitWhenErr bool
	Conn        *zk.Conn
	Config      *Config
}

func NewCmd

func NewCmd(name string, options []string, conn *zk.Conn, config *Config) *Cmd

func (*Cmd) Run

func (c *Cmd) Run()

type Config

type Config struct {
	Servers []string
	Auth    *Auth

	SlientLog bool
}

func NewConfig

func NewConfig(Servers []string, slientLog bool) *Config

func (*Config) Connect

func (c *Config) Connect() (conn *zk.Conn, err error)

type SuggestCache

type SuggestCache struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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