bridge

package
v0.0.0-...-c5b1554 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

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

func New

func New(conn net.Conn, sshconfig *ssh.ServerConfig, bridgeconfig *BridgeConfig, providerCreater func(*ssh.ServerConn) (SessionProvider, error)) (*Bridge, error)

func (*Bridge) Start

func (b *Bridge) Start()

func (*Bridge) Stop

func (b *Bridge) Stop() error

type BridgeConfig

type BridgeConfig struct {
	DefaultCmd  string
	ExecTimeout time.Duration
}

type ExecConfig

type ExecConfig struct {
	Input  io.Reader
	Output io.Writer
	Env    []string
	Cmd    []string
	Tty    bool
}

type ExecResult

type ExecResult struct {
	ExitCode int
	Error    error
}

type ResizeOptions

type ResizeOptions struct {
	Height uint
	Width  uint
}

type SessionProvider

type SessionProvider interface {
	// Resize send resize request to container
	Resize(context.Context, ResizeOptions) error

	// Exec start command in container, will be called only once
	Exec(context.Context, ExecConfig) (<-chan ExecResult, error)
}

Jump to

Keyboard shortcuts

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