agent

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	Config
	Dialer
	TunnelListener
	TunnelChan(api.Tunnel) chan net.Conn
	AgentRegister(net.Conn) (RPC, error)

	ConnectAndServe() error
	Serve(RPC) error
}

inside agent there are: config (static) grpcServer (long lived) rpc client/server (ephemeral)

type Config

type Config interface {
	Info

	GetID() string
	GetName() string
	GetTags() []string

	GetHost() string
	GetPort() string
	GetAddr() string
	GetScheme() string
	GetSchemeWS() string

	GetCmd() []string
	GetReadOnly() bool
	GetVerbose() bool
	GetInsecure() bool
	GetPet() bool

	String() string

	GetVersion() pkg.Version
}

type Dialer

type Dialer interface {
	// Dial() (net.Conn, error)
	// /api/rpc
	// /api/grpc?id=*
	Dial(string, string) (net.Conn, error)
}

type Info

type Info interface {
	GetOS() string
	GetPwd() string
	GetArch() string
	GetDistro() string
	GetHostname() string
	GetUsername() string
}

type RPC

type RPC interface {
	// NewConnection()
	// Ping()
	// Pong()
	// Connect() (net.Conn, error)
	Close()
	Done() <-chan struct{}
	Actions() <-chan func(Agent)
}

type Tty

type Tty interface {
	io.ReadWriteCloser
	Resize(rows int, cols int) error
}

type TtyFactory

type TtyFactory interface {
	MakeTty() (Tty, error)
}

type TunnelListener added in v0.0.10

type TunnelListener interface {
	Accept(api.Tunnel) (net.Conn, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳