Documentation ¶
Index ¶
Constants ¶
View Source
const (
ModuleName = "reverse_tunnel"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tunnel ¶
type Tunnel interface { // ForwardStream performs bi-directional message forwarding between incomingStream and the tunnel. // cb is called with header, messages and trailer coming from the tunnel. It's the callers // responsibility to forward them into the incomingStream. ForwardStream(incomingStream grpc.ServerStream, cb TunnelDataCallback) error // Done must be called when the caller is done with the Tunnel. Done() }
type TunnelDataCallback ¶
type TunnelFinder ¶
type TunnelFinder interface { // FindTunnel finds a tunnel to a matching agentk. // It waits for a matching tunnel to proxy a connection through. When a matching tunnel is found, it is returned. // It only returns errors from the context or context.Canceled if the finder is shutting down. // service and method and gRPC service and method that the agent must support. FindTunnel(ctx context.Context, agentId int64, service, method string) (Tunnel, error) }
type TunnelHandler ¶
type TunnelHandler interface { // HandleTunnel is called with server-side interface of the reverse tunnel. // It registers the tunnel and blocks, waiting for a request to proxy through the tunnel. // The method returns the error value to return to gRPC framework. // ctx can be used to unblock the method if the tunnel is not being used already. // ctx should be a child of the server's context. HandleTunnel(ctx context.Context, agentInfo *api.AgentInfo, server rpc.ReverseTunnel_ConnectServer) error }
type TunnelRegistry ¶
type TunnelRegistry struct {
// contains filtered or unexported fields
}
func NewTunnelRegistry ¶
func NewTunnelRegistry(log *zap.Logger, tunnelRegisterer tracker.Registerer, ownPrivateApiUrl string) (*TunnelRegistry, error)
func (*TunnelRegistry) FindTunnel ¶
func (*TunnelRegistry) HandleTunnel ¶
func (r *TunnelRegistry) HandleTunnel(ctx context.Context, agentInfo *api.AgentInfo, server rpc.ReverseTunnel_ConnectServer) error
Click to show internal directories.
Click to hide internal directories.