Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoAnyTypeResolver = errors.New("no resolver provided for the Any type")
ErrNoAnyTypeResolver is returned if no resolver was provided for the Any type.
Functions ¶
This section is empty.
Types ¶
type AnyTypeResolver ¶
type AnyTypeResolver interface { // FindMessageByURL looks up a message by a URL identifier. // See documentation on google.protobuf.Any.type_url for the URL format. // // Returns the constructor for the message. // This returns (nil, ErrNotFound) if not found. FindMessageByURL(url string) (func() protobuf_go_lite.Message, error) }
AnyTypeResolver is an interface for looking up messages.
A compliant implementation must deterministically return the same type if no error is encountered.
The [Types] type implements this interface.
func NewErrAnyTypeResolver ¶
func NewErrAnyTypeResolver(err error) AnyTypeResolver
NewErrAnyTypeResolver constructs a new AnyTypeResolver that returns an error.
func NewFuncAnyTypeResolver ¶
func NewFuncAnyTypeResolver(findMessageByURL func(url string) (func() protobuf_go_lite.Message, error)) AnyTypeResolver
NewFuncAnyTypeResolver constructs a new AnyTypeResolver with callback funcs.
Click to show internal directories.
Click to hide internal directories.