Documentation ¶
Overview ¶
Package protoconv provides a mechanism to register functions to convert objects to and from proto messages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(toProto, toObject interface{})
Register registers the converters toProto and toObject. toProto must be a function with the signature:
func(context.Context, O) (P, error)
toObject must be a function with the signature:
func(context.Context, P) (O, error)
Where P is the proto message type and O is the object type.
Types ¶
type ErrNoConverterRegistered ¶
type ErrNoConverterRegistered struct {
Object interface{}
}
ErrNoConverterRegistered is the error returned from ToProto or ToObject when the object's type is not registered for conversion.
func (ErrNoConverterRegistered) Error ¶
func (e ErrNoConverterRegistered) Error() string
Click to show internal directories.
Click to hide internal directories.