Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterAdminServer(s grpc.ServiceRegistrar, srv AdminServer)
- func RegisterTunnelServer(s grpc.ServiceRegistrar, srv TunnelServer)
- type AdminClient
- type AdminServer
- type Admin_WatchTunnelsClient
- type Admin_WatchTunnelsServer
- type BlockPeerRequest
- type BlockPeerResponse
- type BlockedPeer
- func (*BlockedPeer) Descriptor() ([]byte, []int)deprecated
- func (x *BlockedPeer) GetBlockedAtUnix() int64
- func (x *BlockedPeer) GetPeer() string
- func (*BlockedPeer) ProtoMessage()
- func (x *BlockedPeer) ProtoReflect() protoreflect.Message
- func (x *BlockedPeer) Reset()
- func (x *BlockedPeer) String() string
- type GoAway
- type Hello
- type ListBlockedRequest
- type ListBlockedResponse
- func (*ListBlockedResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListBlockedResponse) GetPeers() []*BlockedPeer
- func (*ListBlockedResponse) ProtoMessage()
- func (x *ListBlockedResponse) ProtoReflect() protoreflect.Message
- func (x *ListBlockedResponse) Reset()
- func (x *ListBlockedResponse) String() string
- type ListTunnelsRequest
- type ListTunnelsResponse
- func (*ListTunnelsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListTunnelsResponse) GetTunnels() []*TunnelInfo
- func (*ListTunnelsResponse) ProtoMessage()
- func (x *ListTunnelsResponse) ProtoReflect() protoreflect.Message
- func (x *ListTunnelsResponse) Reset()
- func (x *ListTunnelsResponse) String() string
- type StopTunnelRequest
- func (*StopTunnelRequest) Descriptor() ([]byte, []int)deprecated
- func (x *StopTunnelRequest) GetPeer() string
- func (x *StopTunnelRequest) GetReason() string
- func (*StopTunnelRequest) ProtoMessage()
- func (x *StopTunnelRequest) ProtoReflect() protoreflect.Message
- func (x *StopTunnelRequest) Reset()
- func (x *StopTunnelRequest) String() string
- type StopTunnelResponse
- func (*StopTunnelResponse) Descriptor() ([]byte, []int)deprecated
- func (x *StopTunnelResponse) GetStopped() bool
- func (*StopTunnelResponse) ProtoMessage()
- func (x *StopTunnelResponse) ProtoReflect() protoreflect.Message
- func (x *StopTunnelResponse) Reset()
- func (x *StopTunnelResponse) String() string
- type TunnelClient
- type TunnelEvent
- func (*TunnelEvent) Descriptor() ([]byte, []int)deprecated
- func (x *TunnelEvent) GetInfo() *TunnelInfo
- func (x *TunnelEvent) GetKind() TunnelEvent_Kind
- func (x *TunnelEvent) GetReason() string
- func (*TunnelEvent) ProtoMessage()
- func (x *TunnelEvent) ProtoReflect() protoreflect.Message
- func (x *TunnelEvent) Reset()
- func (x *TunnelEvent) String() string
- type TunnelEvent_Kind
- func (TunnelEvent_Kind) Descriptor() protoreflect.EnumDescriptor
- func (x TunnelEvent_Kind) Enum() *TunnelEvent_Kind
- func (TunnelEvent_Kind) EnumDescriptor() ([]byte, []int)deprecated
- func (x TunnelEvent_Kind) Number() protoreflect.EnumNumber
- func (x TunnelEvent_Kind) String() string
- func (TunnelEvent_Kind) Type() protoreflect.EnumType
- type TunnelFrame
- func (*TunnelFrame) Descriptor() ([]byte, []int)deprecated
- func (x *TunnelFrame) GetData() []byte
- func (x *TunnelFrame) GetGoAway() *GoAway
- func (x *TunnelFrame) GetHello() *Hello
- func (x *TunnelFrame) GetKind() isTunnelFrame_Kind
- func (x *TunnelFrame) GetWelcome() *Welcome
- func (*TunnelFrame) ProtoMessage()
- func (x *TunnelFrame) ProtoReflect() protoreflect.Message
- func (x *TunnelFrame) Reset()
- func (x *TunnelFrame) String() string
- type TunnelFrame_Data
- type TunnelFrame_GoAway
- type TunnelFrame_Hello
- type TunnelFrame_Welcome
- type TunnelInfo
- func (*TunnelInfo) Descriptor() ([]byte, []int)deprecated
- func (x *TunnelInfo) GetAttachedAtUnix() int64
- func (x *TunnelInfo) GetPeer() string
- func (x *TunnelInfo) GetPeerVersion() string
- func (*TunnelInfo) ProtoMessage()
- func (x *TunnelInfo) ProtoReflect() protoreflect.Message
- func (x *TunnelInfo) Reset()
- func (x *TunnelInfo) String() string
- type TunnelServer
- type Tunnel_AttachClient
- type Tunnel_AttachServer
- type UnblockPeerRequest
- func (*UnblockPeerRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UnblockPeerRequest) GetPeer() string
- func (*UnblockPeerRequest) ProtoMessage()
- func (x *UnblockPeerRequest) ProtoReflect() protoreflect.Message
- func (x *UnblockPeerRequest) Reset()
- func (x *UnblockPeerRequest) String() string
- type UnblockPeerResponse
- type UnimplementedAdminServer
- func (UnimplementedAdminServer) BlockPeer(context.Context, *BlockPeerRequest) (*BlockPeerResponse, error)
- func (UnimplementedAdminServer) ListBlocked(context.Context, *ListBlockedRequest) (*ListBlockedResponse, error)
- func (UnimplementedAdminServer) ListTunnels(context.Context, *ListTunnelsRequest) (*ListTunnelsResponse, error)
- func (UnimplementedAdminServer) StopTunnel(context.Context, *StopTunnelRequest) (*StopTunnelResponse, error)
- func (UnimplementedAdminServer) UnblockPeer(context.Context, *UnblockPeerRequest) (*UnblockPeerResponse, error)
- func (UnimplementedAdminServer) WatchTunnels(*WatchTunnelsRequest, grpc.ServerStreamingServer[TunnelEvent]) error
- type UnimplementedTunnelServer
- type UnsafeAdminServer
- type UnsafeTunnelServer
- type WatchTunnelsRequest
- type Welcome
Constants ¶
const ( Admin_ListTunnels_FullMethodName = "/openotters.holt.v1.Admin/ListTunnels" Admin_StopTunnel_FullMethodName = "/openotters.holt.v1.Admin/StopTunnel" Admin_BlockPeer_FullMethodName = "/openotters.holt.v1.Admin/BlockPeer" Admin_UnblockPeer_FullMethodName = "/openotters.holt.v1.Admin/UnblockPeer" Admin_ListBlocked_FullMethodName = "/openotters.holt.v1.Admin/ListBlocked" Admin_WatchTunnels_FullMethodName = "/openotters.holt.v1.Admin/WatchTunnels" )
const (
Tunnel_Attach_FullMethodName = "/openotters.holt.v1.Tunnel/Attach"
)
Variables ¶
var ( TunnelEvent_Kind_name = map[int32]string{ 0: "KIND_UNSPECIFIED", 1: "KIND_ATTACHED", 2: "KIND_DETACHED", } TunnelEvent_Kind_value = map[string]int32{ "KIND_UNSPECIFIED": 0, "KIND_ATTACHED": 1, "KIND_DETACHED": 2, } )
Enum value maps for TunnelEvent_Kind.
var Admin_ServiceDesc = grpc.ServiceDesc{ ServiceName: "openotters.holt.v1.Admin", HandlerType: (*AdminServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListTunnels", Handler: _Admin_ListTunnels_Handler, }, { MethodName: "StopTunnel", Handler: _Admin_StopTunnel_Handler, }, { MethodName: "BlockPeer", Handler: _Admin_BlockPeer_Handler, }, { MethodName: "UnblockPeer", Handler: _Admin_UnblockPeer_Handler, }, { MethodName: "ListBlocked", Handler: _Admin_ListBlocked_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "WatchTunnels", Handler: _Admin_WatchTunnels_Handler, ServerStreams: true, }, }, Metadata: "v1/admin.proto", }
Admin_ServiceDesc is the grpc.ServiceDesc for Admin service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_v1_admin_proto protoreflect.FileDescriptor
var File_v1_tunnel_proto protoreflect.FileDescriptor
var Tunnel_ServiceDesc = grpc.ServiceDesc{ ServiceName: "openotters.holt.v1.Tunnel", HandlerType: (*TunnelServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Attach", Handler: _Tunnel_Attach_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "v1/tunnel.proto", }
Tunnel_ServiceDesc is the grpc.ServiceDesc for Tunnel service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterAdminServer ¶
func RegisterAdminServer(s grpc.ServiceRegistrar, srv AdminServer)
func RegisterTunnelServer ¶
func RegisterTunnelServer(s grpc.ServiceRegistrar, srv TunnelServer)
Types ¶
type AdminClient ¶
type AdminClient interface {
ListTunnels(ctx context.Context, in *ListTunnelsRequest, opts ...grpc.CallOption) (*ListTunnelsResponse, error)
StopTunnel(ctx context.Context, in *StopTunnelRequest, opts ...grpc.CallOption) (*StopTunnelResponse, error)
// BlockPeer stops a peer's tunnel AND bans its peer id, so it cannot
// reconnect even with a valid token — versus StopTunnel's plain
// disconnect. The ban is on the identity, not one specific token:
// every token whose subject is that id (including ones minted while
// blocked) is refused until UnblockPeer. Requires the hub to have a
// blocker configured; otherwise returns Unimplemented.
BlockPeer(ctx context.Context, in *BlockPeerRequest, opts ...grpc.CallOption) (*BlockPeerResponse, error)
// UnblockPeer lifts a BlockPeer ban so the peer may reconnect. Tokens
// minted before the block that have not expired become valid again;
// blocking never invalidates the tokens themselves.
UnblockPeer(ctx context.Context, in *UnblockPeerRequest, opts ...grpc.CallOption) (*UnblockPeerResponse, error)
// ListBlocked returns the currently-blocked peers (which have no
// live tunnel to appear in ListTunnels). Empty when no blocker is
// configured.
ListBlocked(ctx context.Context, in *ListBlockedRequest, opts ...grpc.CallOption) (*ListBlockedResponse, error)
// WatchTunnels streams the live-tunnel set: an empty hello event
// first (KIND_UNSPECIFIED, flushes headers so browser clients see
// the subscription immediately), then the current tunnels as
// ATTACHED events (a snapshot), then attach/detach events as they
// happen. An ATTACHED for a peer already seen is a
// harmless duplicate (subscribe and snapshot overlap by design so
// nothing falls in the gap). The stream ends server-side if the
// client falls too far behind; resubscribe and treat the replay as
// a fresh snapshot.
WatchTunnels(ctx context.Context, in *WatchTunnelsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[TunnelEvent], error)
}
AdminClient is the client API for Admin service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
Admin is the hub's management surface: enumerate live tunnels and force one closed. It reflects the hub Registry over the wire so a CLI (or grpcurl) can operate a hub remotely. Mount it behind whatever operator auth the deployment uses.
func NewAdminClient ¶
func NewAdminClient(cc grpc.ClientConnInterface) AdminClient
type AdminServer ¶
type AdminServer interface {
ListTunnels(context.Context, *ListTunnelsRequest) (*ListTunnelsResponse, error)
StopTunnel(context.Context, *StopTunnelRequest) (*StopTunnelResponse, error)
// BlockPeer stops a peer's tunnel AND bans its peer id, so it cannot
// reconnect even with a valid token — versus StopTunnel's plain
// disconnect. The ban is on the identity, not one specific token:
// every token whose subject is that id (including ones minted while
// blocked) is refused until UnblockPeer. Requires the hub to have a
// blocker configured; otherwise returns Unimplemented.
BlockPeer(context.Context, *BlockPeerRequest) (*BlockPeerResponse, error)
// UnblockPeer lifts a BlockPeer ban so the peer may reconnect. Tokens
// minted before the block that have not expired become valid again;
// blocking never invalidates the tokens themselves.
UnblockPeer(context.Context, *UnblockPeerRequest) (*UnblockPeerResponse, error)
// ListBlocked returns the currently-blocked peers (which have no
// live tunnel to appear in ListTunnels). Empty when no blocker is
// configured.
ListBlocked(context.Context, *ListBlockedRequest) (*ListBlockedResponse, error)
// WatchTunnels streams the live-tunnel set: an empty hello event
// first (KIND_UNSPECIFIED, flushes headers so browser clients see
// the subscription immediately), then the current tunnels as
// ATTACHED events (a snapshot), then attach/detach events as they
// happen. An ATTACHED for a peer already seen is a
// harmless duplicate (subscribe and snapshot overlap by design so
// nothing falls in the gap). The stream ends server-side if the
// client falls too far behind; resubscribe and treat the replay as
// a fresh snapshot.
WatchTunnels(*WatchTunnelsRequest, grpc.ServerStreamingServer[TunnelEvent]) error
// contains filtered or unexported methods
}
AdminServer is the server API for Admin service. All implementations must embed UnimplementedAdminServer for forward compatibility.
Admin is the hub's management surface: enumerate live tunnels and force one closed. It reflects the hub Registry over the wire so a CLI (or grpcurl) can operate a hub remotely. Mount it behind whatever operator auth the deployment uses.
type Admin_WatchTunnelsClient ¶ added in v0.3.0
type Admin_WatchTunnelsClient = grpc.ServerStreamingClient[TunnelEvent]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Admin_WatchTunnelsServer ¶ added in v0.3.0
type Admin_WatchTunnelsServer = grpc.ServerStreamingServer[TunnelEvent]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type BlockPeerRequest ¶
type BlockPeerRequest struct {
Peer string `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"`
// contains filtered or unexported fields
}
func (*BlockPeerRequest) Descriptor
deprecated
func (*BlockPeerRequest) Descriptor() ([]byte, []int)
Deprecated: Use BlockPeerRequest.ProtoReflect.Descriptor instead.
func (*BlockPeerRequest) GetPeer ¶
func (x *BlockPeerRequest) GetPeer() string
func (*BlockPeerRequest) ProtoMessage ¶
func (*BlockPeerRequest) ProtoMessage()
func (*BlockPeerRequest) ProtoReflect ¶
func (x *BlockPeerRequest) ProtoReflect() protoreflect.Message
func (*BlockPeerRequest) Reset ¶
func (x *BlockPeerRequest) Reset()
func (*BlockPeerRequest) String ¶
func (x *BlockPeerRequest) String() string
type BlockPeerResponse ¶
type BlockPeerResponse struct {
Stopped bool `protobuf:"varint,1,opt,name=stopped,proto3" json:"stopped,omitempty"` // whether a live tunnel was also closed
// contains filtered or unexported fields
}
func (*BlockPeerResponse) Descriptor
deprecated
func (*BlockPeerResponse) Descriptor() ([]byte, []int)
Deprecated: Use BlockPeerResponse.ProtoReflect.Descriptor instead.
func (*BlockPeerResponse) GetStopped ¶
func (x *BlockPeerResponse) GetStopped() bool
func (*BlockPeerResponse) ProtoMessage ¶
func (*BlockPeerResponse) ProtoMessage()
func (*BlockPeerResponse) ProtoReflect ¶
func (x *BlockPeerResponse) ProtoReflect() protoreflect.Message
func (*BlockPeerResponse) Reset ¶
func (x *BlockPeerResponse) Reset()
func (*BlockPeerResponse) String ¶
func (x *BlockPeerResponse) String() string
type BlockedPeer ¶
type BlockedPeer struct {
Peer string `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"`
BlockedAtUnix int64 `protobuf:"varint,2,opt,name=blocked_at_unix,json=blockedAtUnix,proto3" json:"blocked_at_unix,omitempty"`
// contains filtered or unexported fields
}
func (*BlockedPeer) Descriptor
deprecated
func (*BlockedPeer) Descriptor() ([]byte, []int)
Deprecated: Use BlockedPeer.ProtoReflect.Descriptor instead.
func (*BlockedPeer) GetBlockedAtUnix ¶
func (x *BlockedPeer) GetBlockedAtUnix() int64
func (*BlockedPeer) GetPeer ¶
func (x *BlockedPeer) GetPeer() string
func (*BlockedPeer) ProtoMessage ¶
func (*BlockedPeer) ProtoMessage()
func (*BlockedPeer) ProtoReflect ¶
func (x *BlockedPeer) ProtoReflect() protoreflect.Message
func (*BlockedPeer) Reset ¶
func (x *BlockedPeer) Reset()
func (*BlockedPeer) String ¶
func (x *BlockedPeer) String() string
type GoAway ¶
type GoAway struct {
// "superseded" a newer Attach for the same peer replaced this
//
// tunnel; terminal — another instance owns the
// peer now (redialing would steal it back)
//
// "token-revoked" the peer's credential was revoked; terminal —
//
// do not redial with the same credential
//
// "shutting-down" hub is draining; redial with backoff
// "peer-stopping" deliberate stop; do not redial
//
// Applications may define further reasons; unknown reasons are
// non-terminal (the peer redials with backoff).
Reason string `protobuf:"bytes,1,opt,name=reason,proto3" json:"reason,omitempty"`
// contains filtered or unexported fields
}
func (*GoAway) Descriptor
deprecated
func (*GoAway) ProtoMessage ¶
func (*GoAway) ProtoMessage()
func (*GoAway) ProtoReflect ¶
func (x *GoAway) ProtoReflect() protoreflect.Message
type Hello ¶
type Hello struct {
ProtocolVersion uint32 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` // tunnel framing version; currently 1
PeerVersion string `protobuf:"bytes,2,opt,name=peer_version,json=peerVersion,proto3" json:"peer_version,omitempty"` // peer build version, observability only
// contains filtered or unexported fields
}
func (*Hello) Descriptor
deprecated
func (*Hello) GetPeerVersion ¶
func (*Hello) GetProtocolVersion ¶
func (*Hello) ProtoMessage ¶
func (*Hello) ProtoMessage()
func (*Hello) ProtoReflect ¶
func (x *Hello) ProtoReflect() protoreflect.Message
type ListBlockedRequest ¶
type ListBlockedRequest struct {
// contains filtered or unexported fields
}
func (*ListBlockedRequest) Descriptor
deprecated
func (*ListBlockedRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListBlockedRequest.ProtoReflect.Descriptor instead.
func (*ListBlockedRequest) ProtoMessage ¶
func (*ListBlockedRequest) ProtoMessage()
func (*ListBlockedRequest) ProtoReflect ¶
func (x *ListBlockedRequest) ProtoReflect() protoreflect.Message
func (*ListBlockedRequest) Reset ¶
func (x *ListBlockedRequest) Reset()
func (*ListBlockedRequest) String ¶
func (x *ListBlockedRequest) String() string
type ListBlockedResponse ¶
type ListBlockedResponse struct {
Peers []*BlockedPeer `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"`
// contains filtered or unexported fields
}
func (*ListBlockedResponse) Descriptor
deprecated
func (*ListBlockedResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListBlockedResponse.ProtoReflect.Descriptor instead.
func (*ListBlockedResponse) GetPeers ¶
func (x *ListBlockedResponse) GetPeers() []*BlockedPeer
func (*ListBlockedResponse) ProtoMessage ¶
func (*ListBlockedResponse) ProtoMessage()
func (*ListBlockedResponse) ProtoReflect ¶
func (x *ListBlockedResponse) ProtoReflect() protoreflect.Message
func (*ListBlockedResponse) Reset ¶
func (x *ListBlockedResponse) Reset()
func (*ListBlockedResponse) String ¶
func (x *ListBlockedResponse) String() string
type ListTunnelsRequest ¶
type ListTunnelsRequest struct {
// contains filtered or unexported fields
}
func (*ListTunnelsRequest) Descriptor
deprecated
func (*ListTunnelsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListTunnelsRequest.ProtoReflect.Descriptor instead.
func (*ListTunnelsRequest) ProtoMessage ¶
func (*ListTunnelsRequest) ProtoMessage()
func (*ListTunnelsRequest) ProtoReflect ¶
func (x *ListTunnelsRequest) ProtoReflect() protoreflect.Message
func (*ListTunnelsRequest) Reset ¶
func (x *ListTunnelsRequest) Reset()
func (*ListTunnelsRequest) String ¶
func (x *ListTunnelsRequest) String() string
type ListTunnelsResponse ¶
type ListTunnelsResponse struct {
Tunnels []*TunnelInfo `protobuf:"bytes,1,rep,name=tunnels,proto3" json:"tunnels,omitempty"`
// contains filtered or unexported fields
}
func (*ListTunnelsResponse) Descriptor
deprecated
func (*ListTunnelsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListTunnelsResponse.ProtoReflect.Descriptor instead.
func (*ListTunnelsResponse) GetTunnels ¶
func (x *ListTunnelsResponse) GetTunnels() []*TunnelInfo
func (*ListTunnelsResponse) ProtoMessage ¶
func (*ListTunnelsResponse) ProtoMessage()
func (*ListTunnelsResponse) ProtoReflect ¶
func (x *ListTunnelsResponse) ProtoReflect() protoreflect.Message
func (*ListTunnelsResponse) Reset ¶
func (x *ListTunnelsResponse) Reset()
func (*ListTunnelsResponse) String ¶
func (x *ListTunnelsResponse) String() string
type StopTunnelRequest ¶
type StopTunnelRequest struct {
Peer string `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"`
Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` // GoAway reason sent to the peer; default "stopped-by-operator"
// contains filtered or unexported fields
}
func (*StopTunnelRequest) Descriptor
deprecated
func (*StopTunnelRequest) Descriptor() ([]byte, []int)
Deprecated: Use StopTunnelRequest.ProtoReflect.Descriptor instead.
func (*StopTunnelRequest) GetPeer ¶
func (x *StopTunnelRequest) GetPeer() string
func (*StopTunnelRequest) GetReason ¶
func (x *StopTunnelRequest) GetReason() string
func (*StopTunnelRequest) ProtoMessage ¶
func (*StopTunnelRequest) ProtoMessage()
func (*StopTunnelRequest) ProtoReflect ¶
func (x *StopTunnelRequest) ProtoReflect() protoreflect.Message
func (*StopTunnelRequest) Reset ¶
func (x *StopTunnelRequest) Reset()
func (*StopTunnelRequest) String ¶
func (x *StopTunnelRequest) String() string
type StopTunnelResponse ¶
type StopTunnelResponse struct {
Stopped bool `protobuf:"varint,1,opt,name=stopped,proto3" json:"stopped,omitempty"` // false when no tunnel was attached for that peer
// contains filtered or unexported fields
}
func (*StopTunnelResponse) Descriptor
deprecated
func (*StopTunnelResponse) Descriptor() ([]byte, []int)
Deprecated: Use StopTunnelResponse.ProtoReflect.Descriptor instead.
func (*StopTunnelResponse) GetStopped ¶
func (x *StopTunnelResponse) GetStopped() bool
func (*StopTunnelResponse) ProtoMessage ¶
func (*StopTunnelResponse) ProtoMessage()
func (*StopTunnelResponse) ProtoReflect ¶
func (x *StopTunnelResponse) ProtoReflect() protoreflect.Message
func (*StopTunnelResponse) Reset ¶
func (x *StopTunnelResponse) Reset()
func (*StopTunnelResponse) String ¶
func (x *StopTunnelResponse) String() string
type TunnelClient ¶
type TunnelClient interface {
// Attach opens the reverse tunnel. The peer is the stream client
// and MUST send Hello as its first frame; the hub replies Welcome
// (or closes the stream). From then on only data and go_away
// frames are legal. A second Attach for the same peer replaces the
// first — the older tunnel is closed with GoAway("superseded") so
// a crashed-and-redialed peer never waits out a keepalive timeout.
Attach(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[TunnelFrame, TunnelFrame], error)
}
TunnelClient is the client API for Tunnel service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewTunnelClient ¶
func NewTunnelClient(cc grpc.ClientConnInterface) TunnelClient
type TunnelEvent ¶ added in v0.3.0
type TunnelEvent struct {
Kind TunnelEvent_Kind `protobuf:"varint,1,opt,name=kind,proto3,enum=openotters.holt.v1.TunnelEvent_Kind" json:"kind,omitempty"`
Info *TunnelInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` // fully set on ATTACHED; only peer on DETACHED
Reason string `protobuf:"bytes,3,opt,name=reason,proto3" json:"reason,omitempty"` // detach reason, empty on ATTACHED
// contains filtered or unexported fields
}
func (*TunnelEvent) Descriptor
deprecated
added in
v0.3.0
func (*TunnelEvent) Descriptor() ([]byte, []int)
Deprecated: Use TunnelEvent.ProtoReflect.Descriptor instead.
func (*TunnelEvent) GetInfo ¶ added in v0.3.0
func (x *TunnelEvent) GetInfo() *TunnelInfo
func (*TunnelEvent) GetKind ¶ added in v0.3.0
func (x *TunnelEvent) GetKind() TunnelEvent_Kind
func (*TunnelEvent) GetReason ¶ added in v0.3.0
func (x *TunnelEvent) GetReason() string
func (*TunnelEvent) ProtoMessage ¶ added in v0.3.0
func (*TunnelEvent) ProtoMessage()
func (*TunnelEvent) ProtoReflect ¶ added in v0.3.0
func (x *TunnelEvent) ProtoReflect() protoreflect.Message
func (*TunnelEvent) Reset ¶ added in v0.3.0
func (x *TunnelEvent) Reset()
func (*TunnelEvent) String ¶ added in v0.3.0
func (x *TunnelEvent) String() string
type TunnelEvent_Kind ¶ added in v0.3.0
type TunnelEvent_Kind int32
const ( TunnelEvent_KIND_UNSPECIFIED TunnelEvent_Kind = 0 TunnelEvent_KIND_ATTACHED TunnelEvent_Kind = 1 TunnelEvent_KIND_DETACHED TunnelEvent_Kind = 2 )
func (TunnelEvent_Kind) Descriptor ¶ added in v0.3.0
func (TunnelEvent_Kind) Descriptor() protoreflect.EnumDescriptor
func (TunnelEvent_Kind) Enum ¶ added in v0.3.0
func (x TunnelEvent_Kind) Enum() *TunnelEvent_Kind
func (TunnelEvent_Kind) EnumDescriptor
deprecated
added in
v0.3.0
func (TunnelEvent_Kind) EnumDescriptor() ([]byte, []int)
Deprecated: Use TunnelEvent_Kind.Descriptor instead.
func (TunnelEvent_Kind) Number ¶ added in v0.3.0
func (x TunnelEvent_Kind) Number() protoreflect.EnumNumber
func (TunnelEvent_Kind) String ¶ added in v0.3.0
func (x TunnelEvent_Kind) String() string
func (TunnelEvent_Kind) Type ¶ added in v0.3.0
func (TunnelEvent_Kind) Type() protoreflect.EnumType
type TunnelFrame ¶
type TunnelFrame struct {
// Types that are valid to be assigned to Kind:
//
// *TunnelFrame_Hello
// *TunnelFrame_Welcome
// *TunnelFrame_Data
// *TunnelFrame_GoAway
Kind isTunnelFrame_Kind `protobuf_oneof:"kind"`
// contains filtered or unexported fields
}
func (*TunnelFrame) Descriptor
deprecated
func (*TunnelFrame) Descriptor() ([]byte, []int)
Deprecated: Use TunnelFrame.ProtoReflect.Descriptor instead.
func (*TunnelFrame) GetData ¶
func (x *TunnelFrame) GetData() []byte
func (*TunnelFrame) GetGoAway ¶
func (x *TunnelFrame) GetGoAway() *GoAway
func (*TunnelFrame) GetHello ¶
func (x *TunnelFrame) GetHello() *Hello
func (*TunnelFrame) GetKind ¶
func (x *TunnelFrame) GetKind() isTunnelFrame_Kind
func (*TunnelFrame) GetWelcome ¶
func (x *TunnelFrame) GetWelcome() *Welcome
func (*TunnelFrame) ProtoMessage ¶
func (*TunnelFrame) ProtoMessage()
func (*TunnelFrame) ProtoReflect ¶
func (x *TunnelFrame) ProtoReflect() protoreflect.Message
func (*TunnelFrame) Reset ¶
func (x *TunnelFrame) Reset()
func (*TunnelFrame) String ¶
func (x *TunnelFrame) String() string
type TunnelFrame_Data ¶
type TunnelFrame_Data struct {
Data []byte `protobuf:"bytes,3,opt,name=data,proto3,oneof"` // raw tunnel bytes, at most 32 KiB per frame
}
type TunnelFrame_GoAway ¶
type TunnelFrame_GoAway struct {
GoAway *GoAway `protobuf:"bytes,4,opt,name=go_away,json=goAway,proto3,oneof"` // graceful detach, either direction
}
type TunnelFrame_Hello ¶
type TunnelFrame_Hello struct {
Hello *Hello `protobuf:"bytes,1,opt,name=hello,proto3,oneof"` // peer → hub; must be the first frame
}
type TunnelFrame_Welcome ¶
type TunnelFrame_Welcome struct {
Welcome *Welcome `protobuf:"bytes,2,opt,name=welcome,proto3,oneof"` // hub → peer; must be the first reply
}
type TunnelInfo ¶
type TunnelInfo struct {
Peer string `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"`
PeerVersion string `protobuf:"bytes,2,opt,name=peer_version,json=peerVersion,proto3" json:"peer_version,omitempty"`
AttachedAtUnix int64 `protobuf:"varint,3,opt,name=attached_at_unix,json=attachedAtUnix,proto3" json:"attached_at_unix,omitempty"`
// contains filtered or unexported fields
}
func (*TunnelInfo) Descriptor
deprecated
func (*TunnelInfo) Descriptor() ([]byte, []int)
Deprecated: Use TunnelInfo.ProtoReflect.Descriptor instead.
func (*TunnelInfo) GetAttachedAtUnix ¶
func (x *TunnelInfo) GetAttachedAtUnix() int64
func (*TunnelInfo) GetPeer ¶
func (x *TunnelInfo) GetPeer() string
func (*TunnelInfo) GetPeerVersion ¶
func (x *TunnelInfo) GetPeerVersion() string
func (*TunnelInfo) ProtoMessage ¶
func (*TunnelInfo) ProtoMessage()
func (*TunnelInfo) ProtoReflect ¶
func (x *TunnelInfo) ProtoReflect() protoreflect.Message
func (*TunnelInfo) Reset ¶
func (x *TunnelInfo) Reset()
func (*TunnelInfo) String ¶
func (x *TunnelInfo) String() string
type TunnelServer ¶
type TunnelServer interface {
// Attach opens the reverse tunnel. The peer is the stream client
// and MUST send Hello as its first frame; the hub replies Welcome
// (or closes the stream). From then on only data and go_away
// frames are legal. A second Attach for the same peer replaces the
// first — the older tunnel is closed with GoAway("superseded") so
// a crashed-and-redialed peer never waits out a keepalive timeout.
Attach(grpc.BidiStreamingServer[TunnelFrame, TunnelFrame]) error
// contains filtered or unexported methods
}
TunnelServer is the server API for Tunnel service. All implementations must embed UnimplementedTunnelServer for forward compatibility.
type Tunnel_AttachClient ¶
type Tunnel_AttachClient = grpc.BidiStreamingClient[TunnelFrame, TunnelFrame]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Tunnel_AttachServer ¶
type Tunnel_AttachServer = grpc.BidiStreamingServer[TunnelFrame, TunnelFrame]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type UnblockPeerRequest ¶
type UnblockPeerRequest struct {
Peer string `protobuf:"bytes,1,opt,name=peer,proto3" json:"peer,omitempty"`
// contains filtered or unexported fields
}
func (*UnblockPeerRequest) Descriptor
deprecated
func (*UnblockPeerRequest) Descriptor() ([]byte, []int)
Deprecated: Use UnblockPeerRequest.ProtoReflect.Descriptor instead.
func (*UnblockPeerRequest) GetPeer ¶
func (x *UnblockPeerRequest) GetPeer() string
func (*UnblockPeerRequest) ProtoMessage ¶
func (*UnblockPeerRequest) ProtoMessage()
func (*UnblockPeerRequest) ProtoReflect ¶
func (x *UnblockPeerRequest) ProtoReflect() protoreflect.Message
func (*UnblockPeerRequest) Reset ¶
func (x *UnblockPeerRequest) Reset()
func (*UnblockPeerRequest) String ¶
func (x *UnblockPeerRequest) String() string
type UnblockPeerResponse ¶
type UnblockPeerResponse struct {
// contains filtered or unexported fields
}
func (*UnblockPeerResponse) Descriptor
deprecated
func (*UnblockPeerResponse) Descriptor() ([]byte, []int)
Deprecated: Use UnblockPeerResponse.ProtoReflect.Descriptor instead.
func (*UnblockPeerResponse) ProtoMessage ¶
func (*UnblockPeerResponse) ProtoMessage()
func (*UnblockPeerResponse) ProtoReflect ¶
func (x *UnblockPeerResponse) ProtoReflect() protoreflect.Message
func (*UnblockPeerResponse) Reset ¶
func (x *UnblockPeerResponse) Reset()
func (*UnblockPeerResponse) String ¶
func (x *UnblockPeerResponse) String() string
type UnimplementedAdminServer ¶
type UnimplementedAdminServer struct{}
UnimplementedAdminServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedAdminServer) BlockPeer ¶
func (UnimplementedAdminServer) BlockPeer(context.Context, *BlockPeerRequest) (*BlockPeerResponse, error)
func (UnimplementedAdminServer) ListBlocked ¶
func (UnimplementedAdminServer) ListBlocked(context.Context, *ListBlockedRequest) (*ListBlockedResponse, error)
func (UnimplementedAdminServer) ListTunnels ¶
func (UnimplementedAdminServer) ListTunnels(context.Context, *ListTunnelsRequest) (*ListTunnelsResponse, error)
func (UnimplementedAdminServer) StopTunnel ¶
func (UnimplementedAdminServer) StopTunnel(context.Context, *StopTunnelRequest) (*StopTunnelResponse, error)
func (UnimplementedAdminServer) UnblockPeer ¶
func (UnimplementedAdminServer) UnblockPeer(context.Context, *UnblockPeerRequest) (*UnblockPeerResponse, error)
func (UnimplementedAdminServer) WatchTunnels ¶ added in v0.3.0
func (UnimplementedAdminServer) WatchTunnels(*WatchTunnelsRequest, grpc.ServerStreamingServer[TunnelEvent]) error
type UnimplementedTunnelServer ¶
type UnimplementedTunnelServer struct{}
UnimplementedTunnelServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedTunnelServer) Attach ¶
func (UnimplementedTunnelServer) Attach(grpc.BidiStreamingServer[TunnelFrame, TunnelFrame]) error
type UnsafeAdminServer ¶
type UnsafeAdminServer interface {
// contains filtered or unexported methods
}
UnsafeAdminServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AdminServer will result in compilation errors.
type UnsafeTunnelServer ¶
type UnsafeTunnelServer interface {
// contains filtered or unexported methods
}
UnsafeTunnelServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TunnelServer will result in compilation errors.
type WatchTunnelsRequest ¶ added in v0.3.0
type WatchTunnelsRequest struct {
// contains filtered or unexported fields
}
func (*WatchTunnelsRequest) Descriptor
deprecated
added in
v0.3.0
func (*WatchTunnelsRequest) Descriptor() ([]byte, []int)
Deprecated: Use WatchTunnelsRequest.ProtoReflect.Descriptor instead.
func (*WatchTunnelsRequest) ProtoMessage ¶ added in v0.3.0
func (*WatchTunnelsRequest) ProtoMessage()
func (*WatchTunnelsRequest) ProtoReflect ¶ added in v0.3.0
func (x *WatchTunnelsRequest) ProtoReflect() protoreflect.Message
func (*WatchTunnelsRequest) Reset ¶ added in v0.3.0
func (x *WatchTunnelsRequest) Reset()
func (*WatchTunnelsRequest) String ¶ added in v0.3.0
func (x *WatchTunnelsRequest) String() string
type Welcome ¶
type Welcome struct {
ProtocolVersion uint32 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` // version the hub selected (≤ offered)
// contains filtered or unexported fields
}
func (*Welcome) Descriptor
deprecated
func (*Welcome) GetProtocolVersion ¶
func (*Welcome) ProtoMessage ¶
func (*Welcome) ProtoMessage()
func (*Welcome) ProtoReflect ¶
func (x *Welcome) ProtoReflect() protoreflect.Message