session

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

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

Go to latest
Published: Jan 17, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Init     = 0
	Relay    = 1
	TTY      = 2
	RelayTTY = 3
	SFTP     = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BIO

type BIO interface {
	Init(conf map[string]string)
	// Write .
	Ping() (err error)
	Write(b []byte) (n int, err error)
	//WritePlain(t int, b []byte) (n int, err error)
	WriteWebtty(b []byte) (n int, err error)
	// WriteString .
	//WriteString(str string) (err error)
	// Read .
	Read() (n int, p []byte, err error)
	// Close .
	ResizeTTY(win ssh.Window) (err error)
	WritePipe() (err error)
	Dial() (err error)
	Close() (err error)
	Running() bool
	IsTTY() bool
	Kind() string
}

BIO .

type Docker

type Docker struct {
	Sess          *Instance
	UserName      string
	RoleName      string
	ContainerName string
	PodName       string
	NodeName      string
	NodeHost      string
	NodePort      string
	Cmd           string

	WsConn *websocket.Conn
	// contains filtered or unexported fields
}

Docker .

func (*Docker) Close

func (dc *Docker) Close() (err error)

Close .

func (*Docker) Dial

func (dc *Docker) Dial() (err error)

Dial .

func (*Docker) Init

func (dc *Docker) Init(conf map[string]string)

Init .

func (*Docker) IsTTY

func (dc *Docker) IsTTY() bool

IsTTY .

func (*Docker) Kind

func (dc *Docker) Kind() string

Kind .

func (*Docker) Ping

func (dc *Docker) Ping() (err error)

Ping .

func (*Docker) Read

func (dc *Docker) Read() (mt int, p []byte, err error)

Read .

func (*Docker) ResizeTTY

func (dc *Docker) ResizeTTY(win ssh.Window) error

ResizeTTY .

func (*Docker) Running

func (dc *Docker) Running() bool

Running .

func (*Docker) Write

func (dc *Docker) Write(data []byte) (int, error)

Write .

func (*Docker) WritePipe

func (dc *Docker) WritePipe() (err error)

WritePipe .

func (*Docker) WriteWebtty

func (dc *Docker) WriteWebtty(data []byte) (int, error)

WriteWebtty .

type Instance

type Instance struct {
	Kind string
	User User

	Winch chan ssh.Window

	UIO UIO
	BIO BIO

	Mode int
	// contains filtered or unexported fields
}

Instance .

func New

func New() *Instance

New .

func (*Instance) CloseBIO

func (sess *Instance) CloseBIO()

CloseBIO .

func (*Instance) CloseUIO

func (sess *Instance) CloseUIO()

CloseUIO .

func (*Instance) Completer

func (sess *Instance) Completer() *readline.PrefixCompleter

Completer .

func (*Instance) Exit

func (sess *Instance) Exit()

Exit .

func (*Instance) Relay

func (sess *Instance) Relay()

Relay .

func (*Instance) SFTP

func (sess *Instance) SFTP()

SFTP .

func (*Instance) SetPrompt

func (sess *Instance) SetPrompt()

SetPrompt .

func (*Instance) ShowUsage

func (sess *Instance) ShowUsage()

ShowUsage .

func (*Instance) TTY

func (sess *Instance) TTY(args url.Values)

TTY .

type SSHSess

type SSHSess struct {
	Ss   ssh.Session
	Sess *Instance
}

SSHSess .

func (*SSHSess) Close

func (ss *SSHSess) Close() (err error)

Close .

func (*SSHSess) Kind

func (ss *SSHSess) Kind() string

Kind .

func (*SSHSess) Read

func (ss *SSHSess) Read(buf []byte) (n int, err error)

func (*SSHSess) ReadPipe

func (ss *SSHSess) ReadPipe() (err error)

ReadPipe .

func (*SSHSess) Write

func (ss *SSHSess) Write(b []byte) (n int, err error)

func (*SSHSess) WritePipe

func (ss *SSHSess) WritePipe() (err error)

WritePipe .

func (*SSHSess) WriteString

func (ss *SSHSess) WriteString(str string) (err error)

WriteString .

func (*SSHSess) WriteWebtty

func (ss *SSHSess) WriteWebtty(b []byte) (n int, err error)

WriteWebtty .

type UIO

type UIO interface {
	// Write .
	Write(b []byte) (n int, err error)
	WriteWebtty(b []byte) (n int, err error)
	// WriteString .
	WriteString(str string) (err error)
	// Read .
	Read(buf []byte) (n int, err error)
	// Close .
	WritePipe() (err error)
	Close() (err error)
	Kind() string
}

UIO .

type User

type User struct {
	ID   int
	Name string
	Mail string
}

User .

type WsSess

type WsSess struct {
	Ws   *websocket.Conn
	Sess *Instance
	// contains filtered or unexported fields
}

WsSess .

func (*WsSess) Close

func (ws *WsSess) Close() (err error)

Close .

func (*WsSess) Kind

func (ws *WsSess) Kind() string

Kind .

func (*WsSess) Read

func (ws *WsSess) Read(buf []byte) (n int, err error)

func (*WsSess) ReadPipe

func (ws *WsSess) ReadPipe() (err error)

ReadPipe .

func (*WsSess) Write

func (ws *WsSess) Write(b []byte) (int, error)

Write used to convert plain text to webtty

func (*WsSess) WritePipe

func (ws *WsSess) WritePipe() (err error)

WritePipe .

func (*WsSess) WriteString

func (ws *WsSess) WriteString(str string) (err error)

WriteString .

func (*WsSess) WriteWebtty

func (ws *WsSess) WriteWebtty(b []byte) (n int, err error)

WriteWebtty .

Jump to

Keyboard shortcuts

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