Documentation
¶
Index ¶
- Variables
- func Is(any *types.Any, v interface{}) bool
- func MarshalAny(v interface{}) (*types.Any, error)
- func Register(v interface{}, args ...string)
- func TypeURL(v interface{}) (string, error)
- func UnmarshalAny(any *types.Any) (interface{}, error)
- func UnmarshalByTypeURL(typeURL string, value []byte) (interface{}, error)
- func UnmarshalTo(any *types.Any, out interface{}) error
- func UnmarshalToByTypeURL(typeURL string, value []byte, out interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
func MarshalAny ¶
MarshalAny marshals the value v into an any with the correct TypeUrl. If the provided object is already a proto.Any message, then it will be returned verbatim. If it is of type proto.Message, it will be marshaled as a protocol buffer. Otherwise, the object will be marshaled to json.
func Register ¶
func Register(v interface{}, args ...string)
Register a type with a base URL for JSON marshaling. When the MarshalAny and UnmarshalAny functions are called they will treat the Any type value as JSON. To use protocol buffers for handling the Any value the proto.Register function should be used instead of this function.
func UnmarshalAny ¶
UnmarshalAny unmarshals the any type into a concrete type.
func UnmarshalByTypeURL ¶ added in v1.0.1
func UnmarshalTo ¶ added in v1.0.1
func UnmarshalToByTypeURL ¶ added in v1.0.1
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.