holtv1

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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"
	Admin_Info_FullMethodName         = "/openotters.holt.v1.Admin/Info"
)
View Source
const (
	Tunnel_Attach_FullMethodName = "/openotters.holt.v1.Tunnel/Attach"
)

Variables

View Source
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.

View Source
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,
		},
		{
			MethodName: "Info",
			Handler:    _Admin_Info_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)

View Source
var File_v1_admin_proto protoreflect.FileDescriptor
View Source
var File_v1_tunnel_proto protoreflect.FileDescriptor
View Source
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)
	// Info reports a snapshot of the hub: build version, live counts, and
	// the addresses an operator needs (advertise, proxy, metrics). It is
	// what `holt info` prints.
	Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, 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
	// Info reports a snapshot of the hub: build version, live counts, and
	// the addresses an operator needs (advertise, proxy, metrics). It is
	// what `holt info` prints.
	Info(context.Context, *InfoRequest) (*InfoResponse, 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) Descriptor() ([]byte, []int)

Deprecated: Use GoAway.ProtoReflect.Descriptor instead.

func (*GoAway) GetReason

func (x *GoAway) GetReason() string

func (*GoAway) ProtoMessage

func (*GoAway) ProtoMessage()

func (*GoAway) ProtoReflect

func (x *GoAway) ProtoReflect() protoreflect.Message

func (*GoAway) Reset

func (x *GoAway) Reset()

func (*GoAway) String

func (x *GoAway) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Hello.ProtoReflect.Descriptor instead.

func (*Hello) GetPeerVersion

func (x *Hello) GetPeerVersion() string

func (*Hello) GetProtocolVersion

func (x *Hello) GetProtocolVersion() uint32

func (*Hello) ProtoMessage

func (*Hello) ProtoMessage()

func (*Hello) ProtoReflect

func (x *Hello) ProtoReflect() protoreflect.Message

func (*Hello) Reset

func (x *Hello) Reset()

func (*Hello) String

func (x *Hello) String() string

type InfoRequest added in v0.9.0

type InfoRequest struct {
	// contains filtered or unexported fields
}

func (*InfoRequest) Descriptor deprecated added in v0.9.0

func (*InfoRequest) Descriptor() ([]byte, []int)

Deprecated: Use InfoRequest.ProtoReflect.Descriptor instead.

func (*InfoRequest) ProtoMessage added in v0.9.0

func (*InfoRequest) ProtoMessage()

func (*InfoRequest) ProtoReflect added in v0.9.0

func (x *InfoRequest) ProtoReflect() protoreflect.Message

func (*InfoRequest) Reset added in v0.9.0

func (x *InfoRequest) Reset()

func (*InfoRequest) String added in v0.9.0

func (x *InfoRequest) String() string

type InfoResponse added in v0.9.0

type InfoResponse struct {
	Version         string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	Commit          string `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"`
	Tunnels         int64  `protobuf:"varint,3,opt,name=tunnels,proto3" json:"tunnels,omitempty"`                                           // live tunnels on this hub
	Blocked         int64  `protobuf:"varint,4,opt,name=blocked,proto3" json:"blocked,omitempty"`                                           // banned peer ids
	AdvertiseAddr   string `protobuf:"bytes,5,opt,name=advertise_addr,json=advertiseAddr,proto3" json:"advertise_addr,omitempty"`           // tunnel address stamped into tokens
	ProxyAddr       string `protobuf:"bytes,6,opt,name=proxy_addr,json=proxyAddr,proto3" json:"proxy_addr,omitempty"`                       // header-routed proxy
	RouteHeader     string `protobuf:"bytes,7,opt,name=route_header,json=routeHeader,proto3" json:"route_header,omitempty"`                 // header naming the target peer
	MetricsAddr     string `protobuf:"bytes,8,opt,name=metrics_addr,json=metricsAddr,proto3" json:"metrics_addr,omitempty"`                 // empty when metrics are off
	ExternalUrl     string `protobuf:"bytes,9,opt,name=external_url,json=externalUrl,proto3" json:"external_url,omitempty"`                 // public proxy URL, if set
	TokenTtlSeconds int64  `protobuf:"varint,10,opt,name=token_ttl_seconds,json=tokenTtlSeconds,proto3" json:"token_ttl_seconds,omitempty"` // lifetime of minted tokens
	// contains filtered or unexported fields
}

func (*InfoResponse) Descriptor deprecated added in v0.9.0

func (*InfoResponse) Descriptor() ([]byte, []int)

Deprecated: Use InfoResponse.ProtoReflect.Descriptor instead.

func (*InfoResponse) GetAdvertiseAddr added in v0.9.0

func (x *InfoResponse) GetAdvertiseAddr() string

func (*InfoResponse) GetBlocked added in v0.9.0

func (x *InfoResponse) GetBlocked() int64

func (*InfoResponse) GetCommit added in v0.9.0

func (x *InfoResponse) GetCommit() string

func (*InfoResponse) GetExternalUrl added in v0.9.0

func (x *InfoResponse) GetExternalUrl() string

func (*InfoResponse) GetMetricsAddr added in v0.9.0

func (x *InfoResponse) GetMetricsAddr() string

func (*InfoResponse) GetProxyAddr added in v0.9.0

func (x *InfoResponse) GetProxyAddr() string

func (*InfoResponse) GetRouteHeader added in v0.9.0

func (x *InfoResponse) GetRouteHeader() string

func (*InfoResponse) GetTokenTtlSeconds added in v0.9.0

func (x *InfoResponse) GetTokenTtlSeconds() int64

func (*InfoResponse) GetTunnels added in v0.9.0

func (x *InfoResponse) GetTunnels() int64

func (*InfoResponse) GetVersion added in v0.9.0

func (x *InfoResponse) GetVersion() string

func (*InfoResponse) ProtoMessage added in v0.9.0

func (*InfoResponse) ProtoMessage()

func (*InfoResponse) ProtoReflect added in v0.9.0

func (x *InfoResponse) ProtoReflect() protoreflect.Message

func (*InfoResponse) Reset added in v0.9.0

func (x *InfoResponse) Reset()

func (*InfoResponse) String added in v0.9.0

func (x *InfoResponse) String() string

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) Enum added in v0.3.0

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 (TunnelEvent_Kind) String added in v0.3.0

func (x TunnelEvent_Kind) String() string

func (TunnelEvent_Kind) Type added in v0.3.0

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) Info added in v0.9.0

func (UnimplementedAdminServer) ListBlocked

func (UnimplementedAdminServer) ListTunnels

func (UnimplementedAdminServer) StopTunnel

func (UnimplementedAdminServer) UnblockPeer

func (UnimplementedAdminServer) WatchTunnels added in v0.3.0

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

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) Descriptor() ([]byte, []int)

Deprecated: Use Welcome.ProtoReflect.Descriptor instead.

func (*Welcome) GetProtocolVersion

func (x *Welcome) GetProtocolVersion() uint32

func (*Welcome) ProtoMessage

func (*Welcome) ProtoMessage()

func (*Welcome) ProtoReflect

func (x *Welcome) ProtoReflect() protoreflect.Message

func (*Welcome) Reset

func (x *Welcome) Reset()

func (*Welcome) String

func (x *Welcome) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL