anypb_resolver

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL