grpctunnel

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 8 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

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

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

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

View Source
var File_proto_tunnel_tunnel_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Data.ProtoReflect.Descriptor instead.

func (*Data) GetClose

func (x *Data) GetClose() bool

func (*Data) GetData

func (x *Data) GetData() []byte

func (*Data) GetTag

func (x *Data) GetTag() int32

func (*Data) ProtoMessage

func (*Data) ProtoMessage()

func (*Data) ProtoReflect

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

func (*Data) Reset

func (x *Data) Reset()

func (*Data) String

func (x *Data) String() string

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

Deprecated: Use Session.ProtoReflect.Descriptor instead.

func (*Session) GetAccept

func (x *Session) GetAccept() bool

func (*Session) GetError

func (x *Session) GetError() string

func (*Session) GetTag

func (x *Session) GetTag() int32

func (*Session) GetTarget

func (x *Session) GetTarget() string

func (*Session) GetTargetType

func (x *Session) GetTargetType() string

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) ProtoReflect

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

func (*Session) Reset

func (x *Session) Reset()

func (*Session) String

func (x *Session) String() string

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 (*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) Enum

func (Subscription_SubscriptionOp) EnumDescriptor deprecated

func (Subscription_SubscriptionOp) EnumDescriptor() ([]byte, []int)

Deprecated: Use Subscription_SubscriptionOp.Descriptor instead.

func (Subscription_SubscriptionOp) Number

func (Subscription_SubscriptionOp) String

func (Subscription_SubscriptionOp) Type

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

Deprecated: Use Target.ProtoReflect.Descriptor instead.

func (*Target) GetAccept

func (x *Target) GetAccept() bool

func (*Target) GetError

func (x *Target) GetError() string

func (*Target) GetOp

func (x *Target) GetOp() Target_TargetOp

func (*Target) GetTarget

func (x *Target) GetTarget() string

func (*Target) GetTargetType

func (x *Target) GetTargetType() string

func (*Target) ProtoMessage

func (*Target) ProtoMessage()

func (*Target) ProtoReflect

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

func (*Target) Reset

func (x *Target) Reset()

func (*Target) String

func (x *Target) String() string

type TargetType

type TargetType int32

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

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) 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 (Target_TargetOp) String

func (x Target_TargetOp) String() string

func (Target_TargetOp) Type

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_TunnelClient interface {
	Send(*Data) error
	Recv() (*Data, error)
	grpc.ClientStream
}

type Tunnel_TunnelServer

type Tunnel_TunnelServer interface {
	Send(*Data) error
	Recv() (*Data, error)
	grpc.ServerStream
}

type UnimplementedTunnelServer

type UnimplementedTunnelServer struct {
}

UnimplementedTunnelServer must be embedded to have forward compatible implementations.

func (UnimplementedTunnelServer) Register

func (UnimplementedTunnelServer) Tunnel

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.

Jump to

Keyboard shortcuts

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