protocol

package
v0.0.0-...-fea122b Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_internal_protocol_protocol_proto protoreflect.FileDescriptor
View Source
var Tunnel_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "protocol.Tunnel",
	HandlerType: (*TunnelServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Handshake",
			Handler:    _Tunnel_Handshake_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Mux",
			Handler:       _Tunnel_Mux_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "internal/protocol/protocol.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 HandshakeRequest

type HandshakeRequest struct {
	RemoteBind string `protobuf:"bytes,1,opt,name=remoteBind,proto3" json:"remoteBind,omitempty"`
	// contains filtered or unexported fields
}

func (*HandshakeRequest) Descriptor deprecated

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

Deprecated: Use HandshakeRequest.ProtoReflect.Descriptor instead.

func (*HandshakeRequest) GetRemoteBind

func (x *HandshakeRequest) GetRemoteBind() string

func (*HandshakeRequest) ProtoMessage

func (*HandshakeRequest) ProtoMessage()

func (*HandshakeRequest) ProtoReflect

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

func (*HandshakeRequest) Reset

func (x *HandshakeRequest) Reset()

func (*HandshakeRequest) String

func (x *HandshakeRequest) String() string

type HandshakeResponse

type HandshakeResponse struct {
	RemoteBind string `protobuf:"bytes,1,opt,name=remoteBind,proto3" json:"remoteBind,omitempty"`
	TunnelID   uint64 `protobuf:"varint,2,opt,name=tunnelID,proto3" json:"tunnelID,omitempty"`
	// contains filtered or unexported fields
}

func (*HandshakeResponse) Descriptor deprecated

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

Deprecated: Use HandshakeResponse.ProtoReflect.Descriptor instead.

func (*HandshakeResponse) GetRemoteBind

func (x *HandshakeResponse) GetRemoteBind() string

func (*HandshakeResponse) GetTunnelID

func (x *HandshakeResponse) GetTunnelID() uint64

func (*HandshakeResponse) ProtoMessage

func (*HandshakeResponse) ProtoMessage()

func (*HandshakeResponse) ProtoReflect

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

func (*HandshakeResponse) Reset

func (x *HandshakeResponse) Reset()

func (*HandshakeResponse) String

func (x *HandshakeResponse) String() string

type Packet

type Packet struct {
	TunnelID      uint64 `protobuf:"varint,1,opt,name=tunnelID,proto3" json:"tunnelID,omitempty"`
	ConnID        uint64 `protobuf:"varint,2,opt,name=connID,proto3" json:"connID,omitempty"`
	Payload       []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
	NewConnection bool   `protobuf:"varint,4,opt,name=newConnection,proto3" json:"newConnection,omitempty"`
	// contains filtered or unexported fields
}

func (*Packet) Descriptor deprecated

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

Deprecated: Use Packet.ProtoReflect.Descriptor instead.

func (*Packet) GetConnID

func (x *Packet) GetConnID() uint64

func (*Packet) GetNewConnection

func (x *Packet) GetNewConnection() bool

func (*Packet) GetPayload

func (x *Packet) GetPayload() []byte

func (*Packet) GetTunnelID

func (x *Packet) GetTunnelID() uint64

func (*Packet) ProtoMessage

func (*Packet) ProtoMessage()

func (*Packet) ProtoReflect

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

func (*Packet) Reset

func (x *Packet) Reset()

func (*Packet) String

func (x *Packet) String() string

type TunnelClient

type TunnelClient interface {
	Handshake(ctx context.Context, in *HandshakeRequest, opts ...grpc.CallOption) (*HandshakeResponse, error)
	Mux(ctx context.Context, opts ...grpc.CallOption) (Tunnel_MuxClient, 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 {
	Handshake(context.Context, *HandshakeRequest) (*HandshakeResponse, error)
	Mux(Tunnel_MuxServer) error
	// contains filtered or unexported methods
}

TunnelServer is the server API for Tunnel service. All implementations must embed UnimplementedTunnelServer for forward compatibility

type Tunnel_MuxClient

type Tunnel_MuxClient interface {
	Send(*Packet) error
	Recv() (*Packet, error)
	grpc.ClientStream
}

type Tunnel_MuxServer

type Tunnel_MuxServer interface {
	Send(*Packet) error
	Recv() (*Packet, error)
	grpc.ServerStream
}

type UnimplementedTunnelServer

type UnimplementedTunnelServer struct {
}

UnimplementedTunnelServer must be embedded to have forward compatible implementations.

func (UnimplementedTunnelServer) Handshake

func (UnimplementedTunnelServer) Mux

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