Documentation
¶
Overview ¶
Package protodef provides functions to make dynamic protobuf messages with the use of the groxypb options in protobuf snippets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Definer ¶
type Definer struct {
// contains filtered or unexported fields
}
Definer parses protobuf snippets and builds protobuf messages according to the specified groxy option values.
func NewDefiner ¶
NewDefiner returns a new Definer with the given options applied.
type Template ¶ added in v0.5.0
type Template interface {
DataMap(ctx context.Context, bts []byte) (map[string]any, error)
Matches(ctx context.Context, bts []byte) (bool, error)
Generate(ctx context.Context, data map[string]any) (proto.Message, error)
}
Template is an interface for generating protobuf messages based on templates.
func BuildMessage ¶
BuildMessage parses the protobuf definition with groxy options and returns a proto.Message that can be used to respond requests or match requests to.
Click to show internal directories.
Click to hide internal directories.