encoding

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_transport_internet_grpc_encoding_stream_proto protoreflect.FileDescriptor
View Source
var GRPCService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "xray.transport.internet.grpc.encoding.GRPCService",
	HandlerType: (*GRPCServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Tun",
			Handler:       _GRPCService_Tun_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "TunMulti",
			Handler:       _GRPCService_TunMulti_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "transport/internet/grpc/encoding/stream.proto",
}

GRPCService_ServiceDesc is the grpc.ServiceDesc for GRPCService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func NewHunkConn

func NewHunkConn(hc HunkConn, cancel context.CancelFunc) net.Conn

func NewMultiHunkConn

func NewMultiHunkConn(hc MultiHunkConn, cancel context.CancelFunc) net.Conn

func RegisterGRPCServiceServer

func RegisterGRPCServiceServer(s grpc.ServiceRegistrar, srv GRPCServiceServer)

func RegisterGRPCServiceServerX

func RegisterGRPCServiceServerX(s *grpc.Server, srv GRPCServiceServer, name string)

func ServerDesc

func ServerDesc(name string) grpc.ServiceDesc

Types

type GRPCServiceClient

type GRPCServiceClient interface {
	Tun(ctx context.Context, opts ...grpc.CallOption) (GRPCService_TunClient, error)
	TunMulti(ctx context.Context, opts ...grpc.CallOption) (GRPCService_TunMultiClient, error)
}

GRPCServiceClient is the client API for GRPCService 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.

type GRPCServiceClientX

type GRPCServiceClientX interface {
	TunCustomName(ctx context.Context, name string, opts ...grpc.CallOption) (GRPCService_TunClient, error)
	TunMultiCustomName(ctx context.Context, name string, opts ...grpc.CallOption) (GRPCService_TunMultiClient, error)
	Tun(ctx context.Context, opts ...grpc.CallOption) (GRPCService_TunClient, error)
	TunMulti(ctx context.Context, opts ...grpc.CallOption) (GRPCService_TunMultiClient, error)
}

type GRPCServiceServer

type GRPCServiceServer interface {
	Tun(GRPCService_TunServer) error
	TunMulti(GRPCService_TunMultiServer) error
	// contains filtered or unexported methods
}

GRPCServiceServer is the server API for GRPCService service. All implementations must embed UnimplementedGRPCServiceServer for forward compatibility

type GRPCService_TunClient

type GRPCService_TunClient interface {
	Send(*Hunk) error
	Recv() (*Hunk, error)
	grpc.ClientStream
}

type GRPCService_TunMultiClient

type GRPCService_TunMultiClient interface {
	Send(*MultiHunk) error
	Recv() (*MultiHunk, error)
	grpc.ClientStream
}

type GRPCService_TunMultiServer

type GRPCService_TunMultiServer interface {
	Send(*MultiHunk) error
	Recv() (*MultiHunk, error)
	grpc.ServerStream
}

type GRPCService_TunServer

type GRPCService_TunServer interface {
	Send(*Hunk) error
	Recv() (*Hunk, error)
	grpc.ServerStream
}

type Hunk

type Hunk struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Hunk) Descriptor deprecated

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

Deprecated: Use Hunk.ProtoReflect.Descriptor instead.

func (*Hunk) GetData

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

func (*Hunk) ProtoMessage

func (*Hunk) ProtoMessage()

func (*Hunk) ProtoReflect

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

func (*Hunk) Reset

func (x *Hunk) Reset()

func (*Hunk) String

func (x *Hunk) String() string

type HunkConn

type HunkConn interface {
	Context() context.Context
	Send(*Hunk) error
	Recv() (*Hunk, error)
	SendMsg(m interface{}) error
	RecvMsg(m interface{}) error
}

type HunkReaderWriter

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

func NewHunkReadWriter

func NewHunkReadWriter(hc HunkConn, cancel context.CancelFunc) *HunkReaderWriter

func (*HunkReaderWriter) Close

func (h *HunkReaderWriter) Close() error

func (*HunkReaderWriter) Read

func (h *HunkReaderWriter) Read(buf []byte) (int, error)

func (*HunkReaderWriter) ReadMultiBuffer

func (h *HunkReaderWriter) ReadMultiBuffer() (buf.MultiBuffer, error)

func (*HunkReaderWriter) Write

func (h *HunkReaderWriter) Write(buf []byte) (int, error)

type MultiHunk

type MultiHunk struct {
	Data [][]byte `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*MultiHunk) Descriptor deprecated

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

Deprecated: Use MultiHunk.ProtoReflect.Descriptor instead.

func (*MultiHunk) GetData

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

func (*MultiHunk) ProtoMessage

func (*MultiHunk) ProtoMessage()

func (*MultiHunk) ProtoReflect

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

func (*MultiHunk) Reset

func (x *MultiHunk) Reset()

func (*MultiHunk) String

func (x *MultiHunk) String() string

type MultiHunkConn

type MultiHunkConn interface {
	Context() context.Context
	Send(*MultiHunk) error
	Recv() (*MultiHunk, error)
	SendMsg(m interface{}) error
	RecvMsg(m interface{}) error
}

type MultiHunkReaderWriter

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

func NewMultiHunkReadWriter

func NewMultiHunkReadWriter(hc MultiHunkConn, cancel context.CancelFunc) *MultiHunkReaderWriter

func (*MultiHunkReaderWriter) Close

func (h *MultiHunkReaderWriter) Close() error

func (*MultiHunkReaderWriter) ReadMultiBuffer

func (h *MultiHunkReaderWriter) ReadMultiBuffer() (buf.MultiBuffer, error)

func (*MultiHunkReaderWriter) WriteMultiBuffer

func (h *MultiHunkReaderWriter) WriteMultiBuffer(mb buf.MultiBuffer) error

type StreamCloser

type StreamCloser interface {
	CloseSend() error
}

type UnimplementedGRPCServiceServer

type UnimplementedGRPCServiceServer struct {
}

UnimplementedGRPCServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedGRPCServiceServer) Tun

func (UnimplementedGRPCServiceServer) TunMulti

type UnsafeGRPCServiceServer

type UnsafeGRPCServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeGRPCServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GRPCServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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