Documentation ¶
Index ¶
- Constants
- Variables
- func NewConverter(schemaFile string, soFile string, messageName string) (message.Converter, error)
- type Converter
- type FieldConverter
- func (fc *FieldConverter) DecodeField(src interface{}, field *desc.FieldDescriptor, sn cast.Strictness) (interface{}, error)
- func (fc *FieldConverter) DecodeMap(src map[string]interface{}, ft *desc.MessageDescriptor, sn cast.Strictness) (map[string]interface{}, error)
- func (fc *FieldConverter) DecodeMessage(message *dynamic.Message, outputType *desc.MessageDescriptor) interface{}
- func (fc *FieldConverter) EncodeField(field *desc.FieldDescriptor, v interface{}) (interface{}, error)
Constants ¶
View Source
const ( WrapperBool = "google.protobuf.BoolValue" WrapperBytes = "google.protobuf.BytesValue" WrapperDouble = "google.protobuf.DoubleValue" WrapperFloat = "google.protobuf.FloatValue" WrapperInt32 = "google.protobuf.Int32Value" WrapperInt64 = "google.protobuf.Int64Value" WrapperString = "google.protobuf.StringValue" WrapperUInt32 = "google.protobuf.UInt32Value" WrapperUInt64 = "google.protobuf.UInt64Value" WrapperVoid = "google.protobuf.EMPTY" )
Variables ¶
View Source
var WRAPPER_TYPES = map[string]struct{}{ WrapperBool: {}, WrapperBytes: {}, WrapperDouble: {}, WrapperFloat: {}, WrapperInt32: {}, WrapperInt64: {}, WrapperString: {}, WrapperUInt32: {}, WrapperUInt64: {}, }
Functions ¶
Types ¶
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
type FieldConverter ¶
type FieldConverter struct{}
func GetFieldConverter ¶
func GetFieldConverter() *FieldConverter
func (*FieldConverter) DecodeField ¶
func (fc *FieldConverter) DecodeField(src interface{}, field *desc.FieldDescriptor, sn cast.Strictness) (interface{}, error)
func (*FieldConverter) DecodeMap ¶
func (fc *FieldConverter) DecodeMap(src map[string]interface{}, ft *desc.MessageDescriptor, sn cast.Strictness) (map[string]interface{}, error)
func (*FieldConverter) DecodeMessage ¶
func (fc *FieldConverter) DecodeMessage(message *dynamic.Message, outputType *desc.MessageDescriptor) interface{}
func (*FieldConverter) EncodeField ¶
func (fc *FieldConverter) EncodeField(field *desc.FieldDescriptor, v interface{}) (interface{}, error)
Click to show internal directories.
Click to hide internal directories.