encoder

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EncoderService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "ras.encoder.EncoderService",
	HandlerType: (*EncoderServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Encode",
			Handler:    _EncoderService_Encode_Handler,
		},
		{
			MethodName: "Decode",
			Handler:    _EncoderService_Decode_Handler,
		},
		{
			MethodName: "PacketEncode",
			Handler:    _EncoderService_PacketEncode_Handler,
		},
		{
			MethodName: "PacketDecode",
			Handler:    _EncoderService_PacketDecode_Handler,
		},
		{
			MethodName: "NewPacket",
			Handler:    _EncoderService_NewPacket_Handler,
		},
		{
			MethodName: "NewPacketBytes",
			Handler:    _EncoderService_NewPacketBytes_Handler,
		},
		{
			MethodName: "UnpackPacket",
			Handler:    _EncoderService_UnpackPacket_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "ras/encoder/encoder_service.proto",
}

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

View Source
var File_ras_encoder_encoder_service_proto protoreflect.FileDescriptor

Functions

func RegisterEncoderServiceServer

func RegisterEncoderServiceServer(s grpc.ServiceRegistrar, srv EncoderServiceServer)

Types

type DecodeRequest

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

func (*DecodeRequest) Descriptor deprecated

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

Deprecated: Use DecodeRequest.ProtoReflect.Descriptor instead.

func (*DecodeRequest) GetData

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

func (*DecodeRequest) GetVersion

func (x *DecodeRequest) GetVersion() int32

func (*DecodeRequest) ProtoMessage

func (*DecodeRequest) ProtoMessage()

func (*DecodeRequest) ProtoReflect

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

func (*DecodeRequest) Reset

func (x *DecodeRequest) Reset()

func (*DecodeRequest) String

func (x *DecodeRequest) String() string

type EncodeRequest

type EncodeRequest struct {
	Version int32      `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	Data    *anypb.Any `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*EncodeRequest) Descriptor deprecated

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

Deprecated: Use EncodeRequest.ProtoReflect.Descriptor instead.

func (*EncodeRequest) GetData

func (x *EncodeRequest) GetData() *anypb.Any

func (*EncodeRequest) GetVersion

func (x *EncodeRequest) GetVersion() int32

func (*EncodeRequest) ProtoMessage

func (*EncodeRequest) ProtoMessage()

func (*EncodeRequest) ProtoReflect

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

func (*EncodeRequest) Reset

func (x *EncodeRequest) Reset()

func (*EncodeRequest) String

func (x *EncodeRequest) String() string

type EncoderServiceClient

type EncoderServiceClient interface {
	//codec debug func
	Encode(ctx context.Context, in *EncodeRequest, opts ...grpc.CallOption) (*wrapperspb.BytesValue, error)
	Decode(ctx context.Context, in *DecodeRequest, opts ...grpc.CallOption) (*anypb.Any, error)
	//packet debug func
	PacketEncode(ctx context.Context, in *v1.Packet, opts ...grpc.CallOption) (*wrapperspb.BytesValue, error)
	PacketDecode(ctx context.Context, in *wrapperspb.BytesValue, opts ...grpc.CallOption) (*v1.Packet, error)
	// Конвертирует любой сообщение в пакет
	// Сообщение должно реализовавать интерфейс пакета
	// * PacketType()
	// * Format()
	NewPacket(ctx context.Context, in *anypb.Any, opts ...grpc.CallOption) (*v1.Packet, error)
	// Аналог NewPacket только еще сразу кодирует пакет в байты
	NewPacketBytes(ctx context.Context, in *anypb.Any, opts ...grpc.CallOption) (*wrapperspb.BytesValue, error)
	// Выполняет распаковку пакета в полученное сообщение
	// Распаковывает 1 уровень данных
	// Возможные значения
	// * ras.protocol.v1.ConnectMessageAck
	// * ras.protocol.v1.EndpointFailureAck
	// * ras.protocol.v1.EndpointOpenAck
	// * ras.protocol.v1.EndpointMessage
	UnpackPacket(ctx context.Context, in *v1.Packet, opts ...grpc.CallOption) (*anypb.Any, error)
}

EncoderServiceClient is the client API for EncoderService 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 EncoderServiceServer

type EncoderServiceServer interface {
	//codec debug func
	Encode(context.Context, *EncodeRequest) (*wrapperspb.BytesValue, error)
	Decode(context.Context, *DecodeRequest) (*anypb.Any, error)
	//packet debug func
	PacketEncode(context.Context, *v1.Packet) (*wrapperspb.BytesValue, error)
	PacketDecode(context.Context, *wrapperspb.BytesValue) (*v1.Packet, error)
	// Конвертирует любой сообщение в пакет
	// Сообщение должно реализовавать интерфейс пакета
	// * PacketType()
	// * Format()
	NewPacket(context.Context, *anypb.Any) (*v1.Packet, error)
	// Аналог NewPacket только еще сразу кодирует пакет в байты
	NewPacketBytes(context.Context, *anypb.Any) (*wrapperspb.BytesValue, error)
	// Выполняет распаковку пакета в полученное сообщение
	// Распаковывает 1 уровень данных
	// Возможные значения
	// * ras.protocol.v1.ConnectMessageAck
	// * ras.protocol.v1.EndpointFailureAck
	// * ras.protocol.v1.EndpointOpenAck
	// * ras.protocol.v1.EndpointMessage
	UnpackPacket(context.Context, *v1.Packet) (*anypb.Any, error)
}

EncoderServiceServer is the server API for EncoderService service. All implementations should embed UnimplementedEncoderServiceServer for forward compatibility

type UnimplementedEncoderServiceServer

type UnimplementedEncoderServiceServer struct {
}

UnimplementedEncoderServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedEncoderServiceServer) Decode

func (UnimplementedEncoderServiceServer) Encode

func (UnimplementedEncoderServiceServer) NewPacket

func (UnimplementedEncoderServiceServer) NewPacketBytes

func (UnimplementedEncoderServiceServer) PacketDecode

func (UnimplementedEncoderServiceServer) PacketEncode

func (UnimplementedEncoderServiceServer) UnpackPacket

type UnsafeEncoderServiceServer

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

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

Jump to

Keyboard shortcuts

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