encoder

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// optional bool sensitive_message = 50001;
	E_SensitiveMessage = &file_encoder_proto_extTypes[0]
)

Extension fields to descriptorpb.FieldOptions.

View Source
var File_encoder_proto protoreflect.FileDescriptor
View Source
var Test_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "com.Mahes2.encoder.Test",
	HandlerType: (*TestServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _Test_Get_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "encoder.proto",
}

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

Functions

func RegisterTestServer

func RegisterTestServer(s grpc.ServiceRegistrar, srv TestServer)

Types

type DefaultJSONMarshaller

type DefaultJSONMarshaller struct{}

func (DefaultJSONMarshaller) Marshal

func (DefaultJSONMarshaller) Marshal(v interface{}) ([]byte, error)

type Encoder

type Encoder struct {
	Options
	// contains filtered or unexported fields
}

func Init

func Init(o Options, m Marshaller) Encoder

func InitWithDefaultMarshaller

func InitWithDefaultMarshaller(o Options) Encoder

func (Encoder) Marshal

func (e Encoder) Marshal(m proto.Message) ([]byte, error)

type GetResponse

type GetResponse struct {
	Field1 int32           `protobuf:"varint,1,opt,name=field1,proto3" json:"field1,omitempty"`
	Field2 string          `protobuf:"bytes,2,opt,name=field2,proto3" json:"field2,omitempty"`
	Field3 *Message1       `protobuf:"bytes,3,opt,name=field3,proto3" json:"field3,omitempty"`
	Field4 *Message2       `protobuf:"bytes,4,opt,name=field4,proto3" json:"field4,omitempty"`
	Field5 []*Message3     `protobuf:"bytes,5,rep,name=field5,proto3" json:"field5,omitempty"`
	Field6 *Message4       `protobuf:"bytes,6,opt,name=field6,proto3" json:"field6,omitempty"`
	Field7 map[string]bool `` /* 154-byte string literal not displayed */
	Field8 bool            `protobuf:"varint,8,opt,name=field8,proto3" json:"field8,omitempty"`
	// contains filtered or unexported fields
}

func (*GetResponse) Descriptor deprecated

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

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (*GetResponse) GetField1

func (x *GetResponse) GetField1() int32

func (*GetResponse) GetField2

func (x *GetResponse) GetField2() string

func (*GetResponse) GetField3

func (x *GetResponse) GetField3() *Message1

func (*GetResponse) GetField4

func (x *GetResponse) GetField4() *Message2

func (*GetResponse) GetField5

func (x *GetResponse) GetField5() []*Message3

func (*GetResponse) GetField6

func (x *GetResponse) GetField6() *Message4

func (*GetResponse) GetField7

func (x *GetResponse) GetField7() map[string]bool

func (*GetResponse) GetField8

func (x *GetResponse) GetField8() bool

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

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

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string

type Marshaller

type Marshaller interface {
	Marshal(v interface{}) ([]byte, error)
}

type Message1

type Message1 struct {
	Field1 int32  `protobuf:"varint,1,opt,name=field1,proto3" json:"field1,omitempty"`
	Field2 string `protobuf:"bytes,2,opt,name=field2,proto3" json:"field2,omitempty"`
	// contains filtered or unexported fields
}

func (*Message1) Descriptor deprecated

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

Deprecated: Use Message1.ProtoReflect.Descriptor instead.

func (*Message1) GetField1

func (x *Message1) GetField1() int32

func (*Message1) GetField2

func (x *Message1) GetField2() string

func (*Message1) ProtoMessage

func (*Message1) ProtoMessage()

func (*Message1) ProtoReflect

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

func (*Message1) Reset

func (x *Message1) Reset()

func (*Message1) String

func (x *Message1) String() string

type Message2

type Message2 struct {
	Field1 bool   `protobuf:"varint,1,opt,name=field1,proto3" json:"field1,omitempty"`
	Field2 string `protobuf:"bytes,2,opt,name=field2,proto3" json:"field2,omitempty"`
	// contains filtered or unexported fields
}

func (*Message2) Descriptor deprecated

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

Deprecated: Use Message2.ProtoReflect.Descriptor instead.

func (*Message2) GetField1

func (x *Message2) GetField1() bool

func (*Message2) GetField2

func (x *Message2) GetField2() string

func (*Message2) ProtoMessage

func (*Message2) ProtoMessage()

func (*Message2) ProtoReflect

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

func (*Message2) Reset

func (x *Message2) Reset()

func (*Message2) String

func (x *Message2) String() string

type Message3

type Message3 struct {
	Field1 int32    `protobuf:"varint,1,opt,name=field1,proto3" json:"field1,omitempty"`
	Field2 []string `protobuf:"bytes,2,rep,name=field2,proto3" json:"field2,omitempty"`
	// contains filtered or unexported fields
}

func (*Message3) Descriptor deprecated

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

Deprecated: Use Message3.ProtoReflect.Descriptor instead.

func (*Message3) GetField1

func (x *Message3) GetField1() int32

func (*Message3) GetField2

func (x *Message3) GetField2() []string

func (*Message3) ProtoMessage

func (*Message3) ProtoMessage()

func (*Message3) ProtoReflect

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

func (*Message3) Reset

func (x *Message3) Reset()

func (*Message3) String

func (x *Message3) String() string

type Message4

type Message4 struct {
	Field1 []*Message2 `protobuf:"bytes,1,rep,name=field1,proto3" json:"field1,omitempty"`
	// contains filtered or unexported fields
}

func (*Message4) Descriptor deprecated

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

Deprecated: Use Message4.ProtoReflect.Descriptor instead.

func (*Message4) GetField1

func (x *Message4) GetField1() []*Message2

func (*Message4) ProtoMessage

func (*Message4) ProtoMessage()

func (*Message4) ProtoReflect

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

func (*Message4) Reset

func (x *Message4) Reset()

func (*Message4) String

func (x *Message4) String() string

type Options

type Options struct {
	SensitiveMessageOptions
}

type SensitiveMessageOptions

type SensitiveMessageOptions struct {
	HideSensitiveMessage bool
	Extension            protoreflect.ExtensionType
}

type TestClient

type TestClient interface {
	Get(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetResponse, error)
}

TestClient is the client API for Test 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 NewTestClient

func NewTestClient(cc grpc.ClientConnInterface) TestClient

type TestServer

type TestServer interface {
	Get(context.Context, *emptypb.Empty) (*GetResponse, error)
	// contains filtered or unexported methods
}

TestServer is the server API for Test service. All implementations must embed UnimplementedTestServer for forward compatibility

type UnimplementedTestServer

type UnimplementedTestServer struct {
}

UnimplementedTestServer must be embedded to have forward compatible implementations.

func (UnimplementedTestServer) Get

type UnsafeTestServer

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

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

Jump to

Keyboard shortcuts

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