Documentation ¶
Index ¶
- Variables
- func RegisterTunnelServer(s grpc.ServiceRegistrar, srv TunnelServer)
- type Data
- type RegisterOp
- func (*RegisterOp) Descriptor() ([]byte, []int)deprecated
- func (m *RegisterOp) GetRegistration() isRegisterOp_Registration
- func (x *RegisterOp) GetSession() *Session
- func (x *RegisterOp) GetSubscription() *Subscription
- func (x *RegisterOp) GetTarget() *Target
- func (*RegisterOp) ProtoMessage()
- func (x *RegisterOp) ProtoReflect() protoreflect.Message
- func (x *RegisterOp) Reset()
- func (x *RegisterOp) String() string
- type RegisterOp_Session
- type RegisterOp_Subscription
- type RegisterOp_Target
- type Session
- func (*Session) Descriptor() ([]byte, []int)deprecated
- func (x *Session) GetAccept() bool
- func (x *Session) GetError() string
- func (x *Session) GetTag() int32
- func (x *Session) GetTarget() string
- func (x *Session) GetTargetType() string
- func (*Session) ProtoMessage()
- func (x *Session) ProtoReflect() protoreflect.Message
- func (x *Session) Reset()
- func (x *Session) String() string
- type Subscription
- func (*Subscription) Descriptor() ([]byte, []int)deprecated
- func (x *Subscription) GetAccept() bool
- func (x *Subscription) GetError() string
- func (x *Subscription) GetOp() Subscription_SubscriptionOp
- func (x *Subscription) GetTargetType() string
- func (*Subscription) ProtoMessage()
- func (x *Subscription) ProtoReflect() protoreflect.Message
- func (x *Subscription) Reset()
- func (x *Subscription) String() string
- type Subscription_SubscriptionOp
- func (Subscription_SubscriptionOp) Descriptor() protoreflect.EnumDescriptor
- func (x Subscription_SubscriptionOp) Enum() *Subscription_SubscriptionOp
- func (Subscription_SubscriptionOp) EnumDescriptor() ([]byte, []int)deprecated
- func (x Subscription_SubscriptionOp) Number() protoreflect.EnumNumber
- func (x Subscription_SubscriptionOp) String() string
- func (Subscription_SubscriptionOp) Type() protoreflect.EnumType
- type Target
- func (*Target) Descriptor() ([]byte, []int)deprecated
- func (x *Target) GetAccept() bool
- func (x *Target) GetError() string
- func (x *Target) GetOp() Target_TargetOp
- func (x *Target) GetTarget() string
- func (x *Target) GetTargetType() string
- func (*Target) ProtoMessage()
- func (x *Target) ProtoReflect() protoreflect.Message
- func (x *Target) Reset()
- func (x *Target) String() string
- type TargetType
- type Target_TargetOp
- func (Target_TargetOp) Descriptor() protoreflect.EnumDescriptor
- func (x Target_TargetOp) Enum() *Target_TargetOp
- func (Target_TargetOp) EnumDescriptor() ([]byte, []int)deprecated
- func (x Target_TargetOp) Number() protoreflect.EnumNumber
- func (x Target_TargetOp) String() string
- func (Target_TargetOp) Type() protoreflect.EnumType
- type TunnelClient
- type TunnelServer
- type Tunnel_RegisterClient
- type Tunnel_RegisterServer
- type Tunnel_TunnelClient
- type Tunnel_TunnelServer
- type UnimplementedTunnelServer
- type UnsafeTunnelServer
Constants ¶
This section is empty.
Variables ¶
var ( TargetType_name = map[int32]string{ 0: "UNKNOWN", 22: "SSH", 6653: "OPENFLOW", 9339: "GNMI_GNOI", 9559: "P4_RUNTIME", } TargetType_value = map[string]int32{ "UNKNOWN": 0, "SSH": 22, "OPENFLOW": 6653, "GNMI_GNOI": 9339, "P4_RUNTIME": 9559, } )
Enum value maps for TargetType.
var ( Target_TargetOp_name = map[int32]string{ 0: "UNKNOWN", 1: "ADD", 2: "REMOVE", } Target_TargetOp_value = map[string]int32{ "UNKNOWN": 0, "ADD": 1, "REMOVE": 2, } )
Enum value maps for Target_TargetOp.
var ( Subscription_SubscriptionOp_name = map[int32]string{ 0: "UNKNOWN", 1: "SUBCRIBE", 2: "UNSUBCRIBE", } Subscription_SubscriptionOp_value = map[string]int32{ "UNKNOWN": 0, "SUBCRIBE": 1, "UNSUBCRIBE": 2, } )
Enum value maps for Subscription_SubscriptionOp.
var File_proto_tunnel_tunnel_proto protoreflect.FileDescriptor
var Tunnel_ServiceDesc = grpc.ServiceDesc{ ServiceName: "grpctunnel.Tunnel", HandlerType: (*TunnelServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Register", Handler: _Tunnel_Register_Handler, ServerStreams: true, ClientStreams: true, }, { StreamName: "Tunnel", Handler: _Tunnel_Tunnel_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "proto/tunnel/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 RegisterTunnelServer ¶
func RegisterTunnelServer(s grpc.ServiceRegistrar, srv TunnelServer)
Types ¶
type Data ¶
type Data struct { Tag int32 `protobuf:"varint,1,opt,name=tag,proto3" json:"tag,omitempty"` // Tag associated with the initial TCP stream setup. Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // Bytes received from client connection. Close bool `protobuf:"varint,3,opt,name=close,proto3" json:"close,omitempty"` // Connection has reached EOF. // contains filtered or unexported fields }
func (*Data) Descriptor
deprecated
func (*Data) ProtoMessage ¶
func (*Data) ProtoMessage()
func (*Data) ProtoReflect ¶
func (x *Data) ProtoReflect() protoreflect.Message
type RegisterOp ¶
type RegisterOp struct { // Types that are assignable to Registration: // *RegisterOp_Target // *RegisterOp_Session // *RegisterOp_Subscription Registration isRegisterOp_Registration `protobuf_oneof:"Registration"` // contains filtered or unexported fields }
func (*RegisterOp) Descriptor
deprecated
func (*RegisterOp) Descriptor() ([]byte, []int)
Deprecated: Use RegisterOp.ProtoReflect.Descriptor instead.
func (*RegisterOp) GetRegistration ¶
func (m *RegisterOp) GetRegistration() isRegisterOp_Registration
func (*RegisterOp) GetSession ¶
func (x *RegisterOp) GetSession() *Session
func (*RegisterOp) GetSubscription ¶
func (x *RegisterOp) GetSubscription() *Subscription
func (*RegisterOp) GetTarget ¶
func (x *RegisterOp) GetTarget() *Target
func (*RegisterOp) ProtoMessage ¶
func (*RegisterOp) ProtoMessage()
func (*RegisterOp) ProtoReflect ¶
func (x *RegisterOp) ProtoReflect() protoreflect.Message
func (*RegisterOp) Reset ¶
func (x *RegisterOp) Reset()
func (*RegisterOp) String ¶
func (x *RegisterOp) String() string
type RegisterOp_Session ¶
type RegisterOp_Session struct {
Session *Session `protobuf:"bytes,2,opt,name=session,proto3,oneof"`
}
type RegisterOp_Subscription ¶
type RegisterOp_Subscription struct {
Subscription *Subscription `protobuf:"bytes,3,opt,name=subscription,proto3,oneof"`
}
type RegisterOp_Target ¶
type RegisterOp_Target struct {
Target *Target `protobuf:"bytes,1,opt,name=target,proto3,oneof"`
}
type Session ¶
type Session struct { // The tag associated with the initial TCP stream setup. Tag int32 `protobuf:"varint,1,opt,name=tag,proto3" json:"tag,omitempty"` // Used to ack the connection tag. Accept bool `protobuf:"varint,2,opt,name=accept,proto3" json:"accept,omitempty"` // Target identifies which handler to use for a tunnel stream. Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` // String value of the corresponding TargetType for a standard protocol. // A non-enumerated protocol is supported so long as both tunnel client and // server are in agreement on a particular value. TargetType string `protobuf:"bytes,4,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` // Error allows the register stream to return an error without breaking the // stream. Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*Session) Descriptor
deprecated
func (*Session) GetTargetType ¶
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
func (*Session) ProtoReflect ¶
func (x *Session) ProtoReflect() protoreflect.Message
type Subscription ¶
type Subscription struct { Op Subscription_SubscriptionOp `protobuf:"varint,1,opt,name=op,proto3,enum=grpctunnel.Subscription_SubscriptionOp" json:"op,omitempty"` // Used to ack the registration of (un)subscription. Accept bool `protobuf:"varint,2,opt,name=accept,proto3" json:"accept,omitempty"` // String value of the corresponding TargetType for a standard protocol. // Used to filter targets for subscription. If empty, it will subscribe all. TargetType string `protobuf:"bytes,3,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*Subscription) Descriptor
deprecated
func (*Subscription) Descriptor() ([]byte, []int)
Deprecated: Use Subscription.ProtoReflect.Descriptor instead.
func (*Subscription) GetAccept ¶
func (x *Subscription) GetAccept() bool
func (*Subscription) GetError ¶
func (x *Subscription) GetError() string
func (*Subscription) GetOp ¶
func (x *Subscription) GetOp() Subscription_SubscriptionOp
func (*Subscription) GetTargetType ¶
func (x *Subscription) GetTargetType() string
func (*Subscription) ProtoMessage ¶
func (*Subscription) ProtoMessage()
func (*Subscription) ProtoReflect ¶
func (x *Subscription) ProtoReflect() protoreflect.Message
func (*Subscription) Reset ¶
func (x *Subscription) Reset()
func (*Subscription) String ¶
func (x *Subscription) String() string
type Subscription_SubscriptionOp ¶
type Subscription_SubscriptionOp int32
const ( Subscription_UNKNOWN Subscription_SubscriptionOp = 0 Subscription_SUBCRIBE Subscription_SubscriptionOp = 1 Subscription_UNSUBCRIBE Subscription_SubscriptionOp = 2 )
func (Subscription_SubscriptionOp) Descriptor ¶
func (Subscription_SubscriptionOp) Descriptor() protoreflect.EnumDescriptor
func (Subscription_SubscriptionOp) Enum ¶
func (x Subscription_SubscriptionOp) Enum() *Subscription_SubscriptionOp
func (Subscription_SubscriptionOp) EnumDescriptor
deprecated
func (Subscription_SubscriptionOp) EnumDescriptor() ([]byte, []int)
Deprecated: Use Subscription_SubscriptionOp.Descriptor instead.
func (Subscription_SubscriptionOp) Number ¶
func (x Subscription_SubscriptionOp) Number() protoreflect.EnumNumber
func (Subscription_SubscriptionOp) String ¶
func (x Subscription_SubscriptionOp) String() string
func (Subscription_SubscriptionOp) Type ¶
func (Subscription_SubscriptionOp) Type() protoreflect.EnumType
type Target ¶
type Target struct { Op Target_TargetOp `protobuf:"varint,1,opt,name=op,proto3,enum=grpctunnel.Target_TargetOp" json:"op,omitempty"` // Used to ack the registration of target and target_type. Accept bool `protobuf:"varint,2,opt,name=accept,proto3" json:"accept,omitempty"` // Target identifies which handler to use for a tunnel stream. Target string `protobuf:"bytes,3,opt,name=target,proto3" json:"target,omitempty"` // String value of the corresponding TargetType for a standard protocol. // A non-enumerated protocol is supported so long as both tunnel client and // server are in agreement on a particular value. TargetType string `protobuf:"bytes,4,opt,name=target_type,json=targetType,proto3" json:"target_type,omitempty"` Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*Target) Descriptor
deprecated
func (*Target) GetOp ¶
func (x *Target) GetOp() Target_TargetOp
func (*Target) GetTargetType ¶
func (*Target) ProtoMessage ¶
func (*Target) ProtoMessage()
func (*Target) ProtoReflect ¶
func (x *Target) ProtoReflect() protoreflect.Message
type TargetType ¶
type TargetType int32
const ( TargetType_UNKNOWN TargetType = 0 // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=22 TargetType_SSH TargetType = 22 // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=6653 TargetType_OPENFLOW TargetType = 6653 // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=9339 TargetType_GNMI_GNOI TargetType = 9339 // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=9559 TargetType_P4_RUNTIME TargetType = 9559 )
func (TargetType) Descriptor ¶
func (TargetType) Descriptor() protoreflect.EnumDescriptor
func (TargetType) Enum ¶
func (x TargetType) Enum() *TargetType
func (TargetType) EnumDescriptor
deprecated
func (TargetType) EnumDescriptor() ([]byte, []int)
Deprecated: Use TargetType.Descriptor instead.
func (TargetType) Number ¶
func (x TargetType) Number() protoreflect.EnumNumber
func (TargetType) String ¶
func (x TargetType) String() string
func (TargetType) Type ¶
func (TargetType) Type() protoreflect.EnumType
type Target_TargetOp ¶
type Target_TargetOp int32
const ( Target_UNKNOWN Target_TargetOp = 0 Target_ADD Target_TargetOp = 1 Target_REMOVE Target_TargetOp = 2 )
func (Target_TargetOp) Descriptor ¶
func (Target_TargetOp) Descriptor() protoreflect.EnumDescriptor
func (Target_TargetOp) Enum ¶
func (x Target_TargetOp) Enum() *Target_TargetOp
func (Target_TargetOp) EnumDescriptor
deprecated
func (Target_TargetOp) EnumDescriptor() ([]byte, []int)
Deprecated: Use Target_TargetOp.Descriptor instead.
func (Target_TargetOp) Number ¶
func (x Target_TargetOp) Number() protoreflect.EnumNumber
func (Target_TargetOp) String ¶
func (x Target_TargetOp) String() string
func (Target_TargetOp) Type ¶
func (Target_TargetOp) Type() protoreflect.EnumType
type TunnelClient ¶
type TunnelClient interface { // Register is used to register targets reachable via either the client // or server and request new Tunnel RPC invocations. Register(ctx context.Context, opts ...grpc.CallOption) (Tunnel_RegisterClient, error) // Tunnel allows the tunnel client and server to create a bidirectional stream // in which data can be forwarded. Tunnel(ctx context.Context, opts ...grpc.CallOption) (Tunnel_TunnelClient, 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 TunnelServer ¶
type TunnelServer interface { // Register is used to register targets reachable via either the client // or server and request new Tunnel RPC invocations. Register(Tunnel_RegisterServer) error // Tunnel allows the tunnel client and server to create a bidirectional stream // in which data can be forwarded. Tunnel(Tunnel_TunnelServer) error // contains filtered or unexported methods }
TunnelServer is the server API for Tunnel service. All implementations must embed UnimplementedTunnelServer for forward compatibility
type Tunnel_RegisterClient ¶
type Tunnel_RegisterClient interface { Send(*RegisterOp) error Recv() (*RegisterOp, error) grpc.ClientStream }
type Tunnel_RegisterServer ¶
type Tunnel_RegisterServer interface { Send(*RegisterOp) error Recv() (*RegisterOp, error) grpc.ServerStream }
type Tunnel_TunnelClient ¶
type Tunnel_TunnelServer ¶
type UnimplementedTunnelServer ¶
type UnimplementedTunnelServer struct { }
UnimplementedTunnelServer must be embedded to have forward compatible implementations.
func (UnimplementedTunnelServer) Register ¶
func (UnimplementedTunnelServer) Register(Tunnel_RegisterServer) error
func (UnimplementedTunnelServer) Tunnel ¶
func (UnimplementedTunnelServer) Tunnel(Tunnel_TunnelServer) error
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.