frontend

package
v0.0.0-...-5773fff Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLocalAPIPort = 22322

Variables

This section is empty.

Functions

func CheckLocalPath

func CheckLocalPath(path string) (string, error)

CheckLocalPath see if file exists and determine if it is a directory. Error is returned if file is not exists.

func CreateEmptyTmpFile

func CreateEmptyTmpFile() (string, error)

Types

type Agent

type Agent struct {
	AgentSettings *session.AgentSettings

	Agent *cmd.SSHAgent
}

func NewAgent

func NewAgent(sess *session.AgentSettings) *Agent

func (*Agent) AddKeys

func (a *Agent) AddKeys() error

TODO replace with x/crypto/ssh/agent ?

func (*Agent) Start

func (a *Agent) Start() error

func (*Agent) Stop

func (a *Agent) Stop()

type Check

type Check struct {
	Session *session.Session
	// contains filtered or unexported fields
}

func NewCheck

func NewCheck(sess *session.Session) *Check

func (*Check) AwaitAvailability

func (c *Check) AwaitAvailability() error

func (*Check) ExpectAvailable

func (c *Check) ExpectAvailable() ([]byte, error)

func (*Check) String

func (c *Check) String() string

func (*Check) WithDelaySeconds

func (c *Check) WithDelaySeconds(seconds int) *Check

type Command

type Command struct {
	*process.Executor

	Session *session.Session

	Name string
	Args []string
	Env  []string

	SSHArgs []string
	// contains filtered or unexported fields
}

func NewCommand

func NewCommand(sess *session.Session, name string, arg ...string) *Command

func (*Command) Cmd

func (c *Command) Cmd() *Command

func (*Command) CombinedOutput

func (c *Command) CombinedOutput() ([]byte, error)

func (*Command) OnCommandStart

func (c *Command) OnCommandStart(fn func()) *Command

func (*Command) Output

func (c *Command) Output() ([]byte, []byte, error)

func (*Command) Sudo

func (c *Command) Sudo() *Command

func (*Command) WithSSHArgs

func (c *Command) WithSSHArgs(args ...string) *Command

func (*Command) WithTimeout

func (c *Command) WithTimeout(timeout time.Duration) *Command

type File

type File struct {
	Session *session.Session
}

func NewFile

func NewFile(sess *session.Session) *File

func (*File) Download

func (f *File) Download(remotePath, dstPath string) error

func (*File) DownloadBytes

func (f *File) DownloadBytes(remotePath string) ([]byte, error)

Download remote file and returns its content as an array of bytes.

func (*File) Upload

func (f *File) Upload(srcPath, remotePath string) error

func (*File) UploadBytes

func (f *File) UploadBytes(data []byte, remotePath string) error

UploadBytes creates a tmp file and upload it to remote dstPath

type KubeProxy

type KubeProxy struct {
	Session *session.Session

	KubeProxyPort string
	LocalPort     string
	// contains filtered or unexported fields
}

func NewKubeProxy

func NewKubeProxy(sess *session.Session) *KubeProxy

func (*KubeProxy) Start

func (k *KubeProxy) Start(useLocalPort int) (port string, err error)

func (*KubeProxy) Stop

func (k *KubeProxy) Stop(startID int)

func (*KubeProxy) StopAll

func (k *KubeProxy) StopAll()

type ReverseTunnel

type ReverseTunnel struct {
	Session *session.Session
	Address string
	// contains filtered or unexported fields
}

func NewReverseTunnel

func NewReverseTunnel(sess *session.Session, address string) *ReverseTunnel

func (*ReverseTunnel) Stop

func (t *ReverseTunnel) Stop() error

func (*ReverseTunnel) String

func (t *ReverseTunnel) String() string

func (*ReverseTunnel) Up

func (t *ReverseTunnel) Up() error

type Tunnel

type Tunnel struct {
	Session *session.Session
	Type    string // Remote or Local
	Address string
	// contains filtered or unexported fields
}

func NewTunnel

func NewTunnel(sess *session.Session, ttype, address string) *Tunnel

func (*Tunnel) ConsumeLines

func (t *Tunnel) ConsumeLines(r io.Reader, fn func(l string))

func (*Tunnel) HealthMonitor

func (t *Tunnel) HealthMonitor(errorOutCh chan<- error)

func (*Tunnel) Stop

func (t *Tunnel) Stop()

func (*Tunnel) String

func (t *Tunnel) String() string

func (*Tunnel) Up

func (t *Tunnel) Up() error

type UploadScript

type UploadScript struct {
	Session *session.Session

	ScriptPath string
	Args       []string
	// contains filtered or unexported fields
}

func NewUploadScript

func NewUploadScript(sess *session.Session, scriptPath string, args ...string) *UploadScript

func (*UploadScript) Execute

func (u *UploadScript) Execute() (stdout []byte, err error)

func (*UploadScript) ExecuteBundle

func (u *UploadScript) ExecuteBundle(parentDir, bundleDir string) (stdout []byte, err error)

func (*UploadScript) Sudo

func (u *UploadScript) Sudo() *UploadScript

func (*UploadScript) WithEnvs

func (u *UploadScript) WithEnvs(envs map[string]string) *UploadScript

func (*UploadScript) WithStdoutHandler

func (u *UploadScript) WithStdoutHandler(handler func(string)) *UploadScript

func (*UploadScript) WithTimeout

func (u *UploadScript) WithTimeout(timeout time.Duration) *UploadScript

Jump to

Keyboard shortcuts

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