hub

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: MIT Imports: 5 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 {
	AgentInfo
	pkg.Tider
	SessionManager

	// AddRPCConn(net.Conn)
	AddTerminalConn(net.Conn)
	AddSessionConn(net.Conn) // deprecated in favor of AddTerminalConn
	AddMetricsConn(net.Conn)
	AddSocks5Conn(net.Conn)
	AddFSConn(net.Conn)

	NewTerminal() net.Conn
	NewSession() Session
	NewMetrics() net.Conn
	NewSocks5() net.Conn
	NewFS() net.Conn

	BasicAuth(http.Handler) http.Handler
}

type AgentInfo

type AgentInfo interface {
	GetID() string
	GetName() string
	GetTags() []string
	GetAuth() bool
	GetHtpasswd() map[string]string

	GetOS() string
	GetPwd() string
	GetArch() string
	GetDistro() string
	GetHostname() string
	GetUsername() string

	SetIP(string)
}

type AgentManager

type AgentManager interface {
	pkg.Manager

	AddAgent(Agent)
	GetAgent(string) Agent
	GetAgents() []Agent
}

type Config

type Config interface {
	Port() string
	UseTLS() bool
	Cert() string
	Key() string
	GetVersion() pkg.Version
}

type Hub

type Hub interface {
	AgentManager

	// Serve(net.Listener) error
	GetConfig() Config
	ListenAndServe() error
	ListenAndServeTLS(certFile, keyFile string) error
}

type RPC

type RPC interface {
	pkg.Tider

	Close()
	Done() <-chan struct{}

	NewTerminal() // Terminal
	NewSession()  // Session
	NewMetrics()
	NewSocks5()
	NewFS()

	Ping()
	RemoteIP() string
	Actions() <-chan func(Hub)
	Unregister(Hub)
}

type RPCManager

type RPCManager interface {
	pkg.Manager

	AddRPC(RPC)
	Last() RPC
}

type Session

type Session interface {
	pkg.Tider
	api.SessionClient

	// close the underlying *grpc.ClientConn to release memory
	Close() error
}

type SessionManager

type SessionManager interface {
	pkg.Manager

	AddSession(Session)
	GetSession(string) Session
}

type Terminal

type Terminal interface {
	pkg.Tider
	asciitransport.AsciiTransportClient
}

type TerminalManager

type TerminalManager interface {
	pkg.Manager

	AddTerminal(Terminal)
	GetTerminal(string) Terminal
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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