session

package
v0.0.0-...-0e0b088 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSessionList

func GetSessionList(dir string) ([]string, error)

func SocketHomeDir

func SocketHomeDir() (string, error)

Types

type Command

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

Command user command struct

func GetRootCmd

func GetRootCmd() *Command

func (*Command) Exec

func (c *Command) Exec(p *bufio.Reader) (string, []byte, error)

func (*Command) GetCommandMap

func (c *Command) GetCommandMap() CommandMap

func (*Command) Name

func (c *Command) Name() string

type CommandHandler

type CommandHandler func(*Command, *bufio.Reader) (string, []byte, error)

CommandHandler handle command

type CommandMap

type CommandMap map[string]*Command

Command

type HistoryCmd

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

func NewHistoryCmd

func NewHistoryCmd(len int) *HistoryCmd

func (*HistoryCmd) Add

func (l *HistoryCmd) Add(text string)

Add text into history record

func (*HistoryCmd) Cache

func (l *HistoryCmd) Cache()

func (*HistoryCmd) IsScrolling

func (l *HistoryCmd) IsScrolling() bool

func (*HistoryCmd) LoadCache

func (l *HistoryCmd) LoadCache()

func (*HistoryCmd) Match

func (l *HistoryCmd) Match()

func (*HistoryCmd) NextMatch

func (l *HistoryCmd) NextMatch(key tcell.Key) string

func (*HistoryCmd) SetCurrentText

func (l *HistoryCmd) SetCurrentText(text string)

func (*HistoryCmd) SetScrolling

func (l *HistoryCmd) SetScrolling(b bool)

type OutBuffer

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

func NewBuffer

func NewBuffer(len int) *OutBuffer

func (*OutBuffer) Get

func (b *OutBuffer) Get(n int) [][]byte

func (*OutBuffer) Put

func (b *OutBuffer) Put(data []byte)

type ScheduleTask

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

type Session

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

func NewSession

func NewSession(name, fname string) *Session

func (*Session) Start

func (s *Session) Start()

type Shell

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

func NewShell

func NewShell() *Shell

func (*Shell) Exec

func (s *Shell) Exec(cmd string) (string, []byte, error)

type TaskHandler

type TaskHandler func()

type TaskType

type TaskType int
const (
	Timer TaskType = iota
	Ticker
)

type Terminal

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

Terminal is the interface wraps basic methods for terminal

func NewTerminal

func NewTerminal() *Terminal

func (*Terminal) GetBufferdLines

func (t *Terminal) GetBufferdLines(count int) [][]byte

func (*Terminal) HandleIncoming

func (t *Terminal) HandleIncoming(conn net.Conn)

func (*Terminal) Input

func (t *Terminal) Input(cmd []byte)

func (*Terminal) RunAfter

func (s *Terminal) RunAfter(d time.Duration, f func())

RunAfter wil call f only once when d duration elapsed

func (*Terminal) RunEvery

func (s *Terminal) RunEvery(d time.Duration, f func())

RunEvery will call f periodly when every d duaration elapsed

func (*Terminal) SetConn

func (t *Terminal) SetConn(c *net.UnixConn)

func (*Terminal) Start

func (t *Terminal) Start()

func (*Terminal) Stop

func (t *Terminal) Stop()

type TickTaskMap

type TickTaskMap map[time.Duration][]ScheduleTask

Jump to

Keyboard shortcuts

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