A Converter coverts to/from Go reflect.Value types and protobuf protoreflect.Value types.
| 19 | |
| 20 | // A Converter coverts to/from Go reflect.Value types and protobuf protoreflect.Value types. |
| 21 | type Converter interface { |
| 22 | // PBValueOf converts a reflect.Value to a protoreflect.Value. |
| 23 | PBValueOf(reflect.Value) protoreflect.Value |
| 24 | |
| 25 | // GoValueOf converts a protoreflect.Value to a reflect.Value. |
| 26 | GoValueOf(protoreflect.Value) reflect.Value |
| 27 | |
| 28 | // IsValidPB returns whether a protoreflect.Value is compatible with this type. |
| 29 | IsValidPB(protoreflect.Value) bool |
| 30 | |
| 31 | // IsValidGo returns whether a reflect.Value is compatible with this type. |
| 32 | IsValidGo(reflect.Value) bool |
| 33 | |
| 34 | // New returns a new field value. |
| 35 | // For scalars, it returns the default value of the field. |
| 36 | // For composite types, it returns a new mutable value. |
| 37 | New() protoreflect.Value |
| 38 | |
| 39 | // Zero returns a new field value. |
| 40 | // For scalars, it returns the default value of the field. |
| 41 | // For composite types, it returns an immutable, empty value. |
| 42 | Zero() protoreflect.Value |
| 43 | } |
| 44 | |
| 45 | // NewConverter matches a Go type with a protobuf field and returns a Converter |
| 46 | // that converts between the two. Enums must be a named int32 kind that |
no outgoing calls
no test coverage detected