Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrServiceAlreadyRegistered = errors.New("gateway: service already registered") ErrServiceNotFound = errors.New("gateway: service not found") ErrExtraDataNotAllowed = errors.New("gateway: extra data not allowed") ErrUnknownChannelType = errors.New("gateway: unknown channel type") ErrPermissionDenied = errors.New("gateway: permission denied") )
View Source
var ( ErrInvalidCommand = errors.New("gateway: invalid command") ErrNotFound = errors.New("gateway: not found") )
View Source
var ( ErrInvalidForwardRequest = errors.New("gateway: invalid forward request") ErrInvalidTunnelData = errors.New("gateway: invalid tunnel data") )
Functions ¶
This section is empty.
Types ¶
type Gateway ¶
type Gateway interface {
Close()
HandleConnection(net.Conn)
HandleSocksConnection(net.Conn)
HTTPProxyHandler() http.Handler
ScavengeConnections(time.Duration)
ListUsers(context.Context) (interface{}, error)
ListOnlineUsers(context.Context) (interface{}, error)
ListLocalOnlineUsers(context.Context) (interface{}, error)
GetUser(context.Context, string) (interface{}, error)
GetUserScreenshot(context.Context, string) ([]byte, error)
}
an instance of gateway, contains runtime states
type Settings ¶
type Settings struct {
// version string
Version string
// id of this node, empty disables node registration and mesh tunneling
NodeID string
// address where peer nodes can reach this node, empty means other nodes
// cannot dial this node
NodeAddress string
// host public key of this node, published to the node table so dialing
// peers can pin it
HostPublicKey ssh.PublicKey
// certificate signer used to authenticate to other nodes, a user
// certificate signed by the peer certificate authority with the "peer"
// principal and the node id as key id, nil disables outbound peering
NodeSigner ssh.Signer
// address of the local postgres database bridged for peer nodes, empty
// refuses postgres tunnels
PostgresAddress string
// how often to look for new peer nodes and refresh this node's online
// heartbeat, defaults to 15 seconds; must stay well below
// onlineStaleThreshold or other nodes will consider this node dead
PeerDiscoveryInterval time.Duration
// revokes a user's cached login flags on this node, called by kickUser
// so a kicked user's next login re-reads the database, optional
RevokeLoginFlags func(userId string)
}
Click to show internal directories.
Click to hide internal directories.