encoding

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GRPCService_Tun_FullMethodName      = "/xray.transport.internet.grpc.encoding.GRPCService/Tun"
	GRPCService_TunMulti_FullMethodName = "/xray.transport.internet.grpc.encoding.GRPCService/TunMulti"
)

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, tun, tunMulti string)

func ServerDesc

func ServerDesc(name, tun, tunMulti string) grpc.ServiceDesc

Types

type GRPCServiceClient

type GRPCServiceClient interface {
	Tun(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Hunk, Hunk], error)
	TunMulti(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[MultiHunk, MultiHunk], 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, tun string, opts ...grpc.CallOption) (GRPCService_TunClient, error)
	TunMultiCustomName(ctx context.Context, name, tunMulti 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(grpc.BidiStreamingServer[Hunk, Hunk]) error
	TunMulti(grpc.BidiStreamingServer[MultiHunk, MultiHunk]) 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 = grpc.BidiStreamingClient[Hunk, Hunk]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type GRPCService_TunMultiClient

type GRPCService_TunMultiClient = grpc.BidiStreamingClient[MultiHunk, MultiHunk]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type GRPCService_TunMultiServer

type GRPCService_TunMultiServer = grpc.BidiStreamingServer[MultiHunk, MultiHunk]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type GRPCService_TunServer

type GRPCService_TunServer = grpc.BidiStreamingServer[Hunk, Hunk]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

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.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

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