cli

package
v0.0.0-...-feac1bc Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IAC_NONE    = iota
	IAC_CMD     = iota
	IAC_OPT     = iota
	IAC_SUB     = iota
	IAC_SUB_IAC = iota
)

Variables

This section is empty.

Functions

func Execute

func Execute(ctx command.ConfContext, line string, isLine, history bool, c *Client)

func InputLoop

func InputLoop(s *Server, c *Client, notifyAppInputClosed bool)

func ListenTelnet

func ListenTelnet(addr string, cliServer *Server)

func OutputLoop

func OutputLoop(c *Client)

Types

type Client

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

func NewClient

func NewClient(conn net.Conn) *Client

func (*Client) ConfigPath

func (c *Client) ConfigPath() string

func (*Client) ConfigPathSet

func (c *Client) ConfigPathSet(path string)

func (*Client) DiscardOutputQueue

func (c *Client) DiscardOutputQueue()

func (*Client) Echo

func (c *Client) Echo() bool

func (*Client) EchoDisable

func (c *Client) EchoDisable()

func (*Client) EchoEnable

func (c *Client) EchoEnable()

func (*Client) Flush

func (c *Client) Flush()

func (*Client) HistoryAdd

func (c *Client) HistoryAdd(cmd string)

func (*Client) HistoryNext

func (c *Client) HistoryNext() string

func (*Client) HistoryPrevious

func (c *Client) HistoryPrevious() string

func (*Client) HistoryReset

func (c *Client) HistoryReset()

func (*Client) HistoryShow

func (c *Client) HistoryShow()

func (*Client) InputQuit

func (c *Client) InputQuit()

func (*Client) LineBufferComplete

func (c *Client) LineBufferComplete(autoComplete string, attach bool)

func (*Client) Newline

func (c *Client) Newline()

func (*Client) Output

func (c *Client) Output() chan<- string

func (*Client) RedrawLineBuffer

func (c *Client) RedrawLineBuffer()

redraw line edit buffer

func (*Client) Send

func (c *Client) Send(msg string) int

enqueue message for client break messages into LF-terminated lines append every line to outputQueue

func (*Client) SendEveryChar

func (c *Client) SendEveryChar() bool

func (*Client) SendNow

func (c *Client) SendNow(msg string)

func (*Client) SendPrompt

func (c *Client) SendPrompt(host string, paging bool)

func (*Client) SendQueue

func (c *Client) SendQueue() bool

send lines from outputQueue, paging on terminal height

func (*Client) Sendln

func (c *Client) Sendln(msg string) int

func (*Client) SendlnNow

func (c *Client) SendlnNow(msg string)

func (*Client) SetSendEveryChar

func (c *Client) SetSendEveryChar(mode bool)

func (*Client) Status

func (c *Client) Status() int

func (*Client) StatusConf

func (c *Client) StatusConf()

func (*Client) StatusEnable

func (c *Client) StatusEnable()

func (*Client) StatusExit

func (c *Client) StatusExit()

func (*Client) StatusSet

func (c *Client) StatusSet(status int)

func (*Client) TermSize

func (c *Client) TermSize() (int, int)

func (*Client) TermSizeSet

func (c *Client) TermSizeSet(w, h int)

func (*Client) Username

func (c *Client) Username() string

func (*Client) UsernameSet

func (c *Client) UsernameSet(username string)

type Command

type Command struct {
	Client          *Client
	Cmd             string
	IsLine          bool // true=line false=char
	HideFromHistory bool
}

Command is copied from cli.InputLoop goroutine to main goroutine

type Server

type Server struct {
	CommandChannel chan Command
	InputClosed    chan *Client
}

func NewServer

func NewServer() *Server

Jump to

Keyboard shortcuts

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