Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
This section is empty.
Types ¶
type HTTPOptions ¶
type HTTPOptions struct { // Timeout specifies a time limit for requests made by this client Timeout time.Duration // Headers provide extra headers to be added in requests made by this client Headers map[string]string }
HTTPOptions options for http client
type Options ¶
type Options struct { // AutoRefresh boolean to enable or disable autorefresh. Default to false AutoRefresh bool // RefreshInterval refresh interval to fetch descriptor file from server. RefreshInterval time.Duration // HTTPOptions options for http client HTTPOptions }
Options options for stencil client
type StencilClient ¶
type StencilClient interface { // Parse parses protobuf message from wire format to protoreflect.Message given fully qualified name of proto message. // Returns ErrNotFound error if given class name is not found Parse(string, []byte) (protoreflect.ProtoMessage, error) // GetDescriptor returns protoreflect.MessageDescriptor given fully qualified proto java class name GetDescriptor(string) (protoreflect.MessageDescriptor, error) // Close stops background refresh if configured. Close() }
StencilClient provides utility functions to parse protobuf messages at runtime. protobuf messages can be identified by specifying fully qualified generated proto java class name.
func NewClient ¶
func NewClient(url string, options Options) (StencilClient, error)
NewClient creates stencil client
func NewMultiURLClient ¶
func NewMultiURLClient(urls []string, options Options) (StencilClient, error)
NewMultiURLClient creates stencil client with multiple urls
Click to show internal directories.
Click to hide internal directories.