sandbox

package
v0.0.0-...-37acf21 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContainerName

func GetContainerName(account string) string

GetContainerName get container name for account

func ScriptSeedSSHConfig

func ScriptSeedSSHConfig(entries []SSHEntry) string

ScriptSeedSSHConfig create a script for seeding .ssh/config

Types

type ExecAttachOptions

type ExecAttachOptions struct {
	Env        []string
	Command    []string
	Stdin      io.Reader
	Stdout     io.Writer
	Stderr     io.Writer
	IsPty      bool
	Term       string
	WindowChan chan Window
}

ExecAttachOptions opts for exec attach

type Manager

type Manager interface {
	FindOrCreate(account string) (Sandbox, error)
}

Manager manager interface

func NewManager

func NewManager(cfg types.SSHDOptions) (m Manager, err error)

NewManager new manager

type Pty

type Pty struct {
	Term   string
	Window Window
}

Pty pty information

type SSHEntry

type SSHEntry struct {
	Name string
	Host string
	Port uint
	User string
}

SSHEntry a entry in ssh_config

type Sandbox

type Sandbox interface {
	GetContainerName() string
	Start() error
	GenerateSSHKey() error
	GetSSHPublicKey() (string, error)
	ExecScript(sc string) (string, string, error)
	ExecAttach(opts ExecAttachOptions) error
}

Sandbox interface

type Window

type Window struct {
	Width  uint
	Height uint
}

Window pty window size

Jump to

Keyboard shortcuts

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