client

package
v0.0.0-...-d88c8b5 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Error_name = map[int32]string{
	0: "EOF",
}
View Source
var Error_value = map[string]int32{
	"EOF": 0,
}
View Source
var PacketType_name = map[int32]string{
	0: "DIAL_REQ",
	1: "DIAL_RSP",
	2: "CLOSE_REQ",
	3: "CLOSE_RSP",
	4: "DATA",
}
View Source
var PacketType_value = map[string]int32{
	"DIAL_REQ":  0,
	"DIAL_RSP":  1,
	"CLOSE_REQ": 2,
	"CLOSE_RSP": 3,
	"DATA":      4,
}

Functions

func RegisterProxyServiceServer

func RegisterProxyServiceServer(s *grpc.Server, srv ProxyServiceServer)

Types

type CloseRequest

type CloseRequest struct {
	// connectID of the stream to close
	ConnectID            int64    `protobuf:"varint,1,opt,name=connectID,proto3" json:"connectID,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CloseRequest) Descriptor

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

func (*CloseRequest) GetConnectID

func (m *CloseRequest) GetConnectID() int64

func (*CloseRequest) ProtoMessage

func (*CloseRequest) ProtoMessage()

func (*CloseRequest) Reset

func (m *CloseRequest) Reset()

func (*CloseRequest) String

func (m *CloseRequest) String() string

func (*CloseRequest) XXX_DiscardUnknown

func (m *CloseRequest) XXX_DiscardUnknown()

func (*CloseRequest) XXX_Marshal

func (m *CloseRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CloseRequest) XXX_Merge

func (m *CloseRequest) XXX_Merge(src proto.Message)

func (*CloseRequest) XXX_Size

func (m *CloseRequest) XXX_Size() int

func (*CloseRequest) XXX_Unmarshal

func (m *CloseRequest) XXX_Unmarshal(b []byte) error

type CloseResponse

type CloseResponse struct {
	// error message
	Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	// connectID indicates the identifier of the connection
	ConnectID            int64    `protobuf:"varint,2,opt,name=connectID,proto3" json:"connectID,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*CloseResponse) Descriptor

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

func (*CloseResponse) GetConnectID

func (m *CloseResponse) GetConnectID() int64

func (*CloseResponse) GetError

func (m *CloseResponse) GetError() string

func (*CloseResponse) ProtoMessage

func (*CloseResponse) ProtoMessage()

func (*CloseResponse) Reset

func (m *CloseResponse) Reset()

func (*CloseResponse) String

func (m *CloseResponse) String() string

func (*CloseResponse) XXX_DiscardUnknown

func (m *CloseResponse) XXX_DiscardUnknown()

func (*CloseResponse) XXX_Marshal

func (m *CloseResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CloseResponse) XXX_Merge

func (m *CloseResponse) XXX_Merge(src proto.Message)

func (*CloseResponse) XXX_Size

func (m *CloseResponse) XXX_Size() int

func (*CloseResponse) XXX_Unmarshal

func (m *CloseResponse) XXX_Unmarshal(b []byte) error

type Data

type Data struct {
	// connectID to connect to
	ConnectID int64 `protobuf:"varint,1,opt,name=connectID,proto3" json:"connectID,omitempty"`
	// error message if error happens
	Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	// stream data
	Data                 []byte   `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Data) Descriptor

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

func (*Data) GetConnectID

func (m *Data) GetConnectID() int64

func (*Data) GetData

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

func (*Data) GetError

func (m *Data) GetError() string

func (*Data) ProtoMessage

func (*Data) ProtoMessage()

func (*Data) Reset

func (m *Data) Reset()

func (*Data) String

func (m *Data) String() string

func (*Data) XXX_DiscardUnknown

func (m *Data) XXX_DiscardUnknown()

func (*Data) XXX_Marshal

func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Data) XXX_Merge

func (m *Data) XXX_Merge(src proto.Message)

func (*Data) XXX_Size

func (m *Data) XXX_Size() int

func (*Data) XXX_Unmarshal

func (m *Data) XXX_Unmarshal(b []byte) error

type DialRequest

type DialRequest struct {
	// tcp or udp?
	Protocol string `protobuf:"bytes,1,opt,name=protocol,proto3" json:"protocol,omitempty"`
	// node:port
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	// random id for client, maybe should be longer
	Random               int64    `protobuf:"varint,3,opt,name=random,proto3" json:"random,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DialRequest) Descriptor

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

func (*DialRequest) GetAddress

func (m *DialRequest) GetAddress() string

func (*DialRequest) GetProtocol

func (m *DialRequest) GetProtocol() string

func (*DialRequest) GetRandom

func (m *DialRequest) GetRandom() int64

func (*DialRequest) ProtoMessage

func (*DialRequest) ProtoMessage()

func (*DialRequest) Reset

func (m *DialRequest) Reset()

func (*DialRequest) String

func (m *DialRequest) String() string

func (*DialRequest) XXX_DiscardUnknown

func (m *DialRequest) XXX_DiscardUnknown()

func (*DialRequest) XXX_Marshal

func (m *DialRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DialRequest) XXX_Merge

func (m *DialRequest) XXX_Merge(src proto.Message)

func (*DialRequest) XXX_Size

func (m *DialRequest) XXX_Size() int

func (*DialRequest) XXX_Unmarshal

func (m *DialRequest) XXX_Unmarshal(b []byte) error

type DialResponse

type DialResponse struct {
	// error failed reason; enum?
	Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	// connectID indicates the identifier of the connection
	ConnectID int64 `protobuf:"varint,2,opt,name=connectID,proto3" json:"connectID,omitempty"`
	// random copied from DialRequest
	Random               int64    `protobuf:"varint,3,opt,name=random,proto3" json:"random,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DialResponse) Descriptor

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

func (*DialResponse) GetConnectID

func (m *DialResponse) GetConnectID() int64

func (*DialResponse) GetError

func (m *DialResponse) GetError() string

func (*DialResponse) GetRandom

func (m *DialResponse) GetRandom() int64

func (*DialResponse) ProtoMessage

func (*DialResponse) ProtoMessage()

func (*DialResponse) Reset

func (m *DialResponse) Reset()

func (*DialResponse) String

func (m *DialResponse) String() string

func (*DialResponse) XXX_DiscardUnknown

func (m *DialResponse) XXX_DiscardUnknown()

func (*DialResponse) XXX_Marshal

func (m *DialResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DialResponse) XXX_Merge

func (m *DialResponse) XXX_Merge(src proto.Message)

func (*DialResponse) XXX_Size

func (m *DialResponse) XXX_Size() int

func (*DialResponse) XXX_Unmarshal

func (m *DialResponse) XXX_Unmarshal(b []byte) error

type Error

type Error int32
const (
	Error_EOF Error = 0
)

func (Error) EnumDescriptor

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

func (Error) String

func (x Error) String() string

type Packet

type Packet struct {
	Type PacketType `protobuf:"varint,1,opt,name=type,proto3,enum=PacketType" json:"type,omitempty"`
	// Types that are valid to be assigned to Payload:
	//	*Packet_DialRequest
	//	*Packet_DialResponse
	//	*Packet_Data
	//	*Packet_CloseRequest
	//	*Packet_CloseResponse
	Payload              isPacket_Payload `protobuf_oneof:"payload"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*Packet) Descriptor

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

func (*Packet) GetCloseRequest

func (m *Packet) GetCloseRequest() *CloseRequest

func (*Packet) GetCloseResponse

func (m *Packet) GetCloseResponse() *CloseResponse

func (*Packet) GetData

func (m *Packet) GetData() *Data

func (*Packet) GetDialRequest

func (m *Packet) GetDialRequest() *DialRequest

func (*Packet) GetDialResponse

func (m *Packet) GetDialResponse() *DialResponse

func (*Packet) GetPayload

func (m *Packet) GetPayload() isPacket_Payload

func (*Packet) GetType

func (m *Packet) GetType() PacketType

func (*Packet) ProtoMessage

func (*Packet) ProtoMessage()

func (*Packet) Reset

func (m *Packet) Reset()

func (*Packet) String

func (m *Packet) String() string

func (*Packet) XXX_DiscardUnknown

func (m *Packet) XXX_DiscardUnknown()

func (*Packet) XXX_Marshal

func (m *Packet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Packet) XXX_Merge

func (m *Packet) XXX_Merge(src proto.Message)

func (*Packet) XXX_OneofWrappers

func (*Packet) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Packet) XXX_Size

func (m *Packet) XXX_Size() int

func (*Packet) XXX_Unmarshal

func (m *Packet) XXX_Unmarshal(b []byte) error

type PacketType

type PacketType int32
const (
	PacketType_DIAL_REQ  PacketType = 0
	PacketType_DIAL_RSP  PacketType = 1
	PacketType_CLOSE_REQ PacketType = 2
	PacketType_CLOSE_RSP PacketType = 3
	PacketType_DATA      PacketType = 4
)

func (PacketType) EnumDescriptor

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

func (PacketType) String

func (x PacketType) String() string

type Packet_CloseRequest

type Packet_CloseRequest struct {
	CloseRequest *CloseRequest `protobuf:"bytes,5,opt,name=closeRequest,proto3,oneof"`
}

type Packet_CloseResponse

type Packet_CloseResponse struct {
	CloseResponse *CloseResponse `protobuf:"bytes,6,opt,name=closeResponse,proto3,oneof"`
}

type Packet_Data

type Packet_Data struct {
	Data *Data `protobuf:"bytes,4,opt,name=data,proto3,oneof"`
}

type Packet_DialRequest

type Packet_DialRequest struct {
	DialRequest *DialRequest `protobuf:"bytes,2,opt,name=dialRequest,proto3,oneof"`
}

type Packet_DialResponse

type Packet_DialResponse struct {
	DialResponse *DialResponse `protobuf:"bytes,3,opt,name=dialResponse,proto3,oneof"`
}

type ProxyServiceClient

type ProxyServiceClient interface {
	Proxy(ctx context.Context, opts ...grpc.CallOption) (ProxyService_ProxyClient, error)
}

ProxyServiceClient is the client API for ProxyService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewProxyServiceClient

func NewProxyServiceClient(cc *grpc.ClientConn) ProxyServiceClient

type ProxyServiceServer

type ProxyServiceServer interface {
	Proxy(ProxyService_ProxyServer) error
}

ProxyServiceServer is the server API for ProxyService service.

type ProxyService_ProxyClient

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

type ProxyService_ProxyServer

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

type UnimplementedProxyServiceServer

type UnimplementedProxyServiceServer struct {
}

UnimplementedProxyServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedProxyServiceServer) Proxy

Jump to

Keyboard shortcuts

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