agent

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: MIT Imports: 3 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
	AgentRegister(net.Conn) (RPC, error)

	AcceptFS() (net.Conn, error)
	AcceptGrpc() (net.Conn, error)
	AcceptSocks5() (net.Conn, error)
	AcceptMetrics() (net.Conn, error)
	AcceptTerminal() (net.Conn, error)

	ConnectAndServe() error
	Serve(RPC) error

	FSChanConn() chan<- net.Conn
	GrpcChanConn() chan<- net.Conn
	Socks5ChanConn() chan<- net.Conn
	MetricsChanConn() chan<- net.Conn
	TerminalChanConn() chan<- net.Conn
}

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 FileServer

type FileServer interface {
	ChanConn() chan<- net.Conn
}

type GrpcServer

type GrpcServer interface {
	ChanConn() chan<- net.Conn
}

type Info

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

type MetricsServer

type MetricsServer interface {
	ChanConn() chan<- net.Conn
}

type RPC

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

type Socks5Server

type Socks5Server interface {
	ChanConn() chan<- net.Conn
}

type TerminalServer

type TerminalServer interface {
	ChanConn() chan<- net.Conn
}

type Tty

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

type TtyFactory

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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