term

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(addr string, auth string) error

Types

type CmdFunc

type CmdFunc func(cmd ...string) (string, error)

func Conn

func Conn(cli *ssdb.Client) (CmdFunc, error)

type Extra

type Extra struct {
	Map   map[string]CmdFunc
	Other CmdFunc
}

func NewExtra

func NewExtra(other CmdFunc) *Extra

func (*Extra) AddCmd

func (e *Extra) AddCmd(name string, fun CmdFunc)

func (*Extra) Cmd

func (e *Extra) Cmd(cmd ...string) (string, error)

type Terminal

type Terminal struct {
	Reader  io.Reader
	Writer  io.Writer
	Prompt  string
	CmdFunc CmdFunc
}

Terminal Is a terminal renderer.

func NewTerminal

func NewTerminal(prompt string, cmd CmdFunc) *Terminal

NewTerminal Create a new Terminal.

func (*Terminal) Run

func (c *Terminal) Run() error

Run Is run the terminal.

Jump to

Keyboard shortcuts

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