Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MethodConfig ¶
type MethodConfig struct { Descriptor protoreflect.MethodDescriptor MethodPath string }
type RouteMethods ¶
type RouteMethods map[string]*RouteTarget
type RouteTarget ¶
type RouteTarget struct { GrpcMethodName string HttpMethod string HttpPath []string Verb string RequestBodyFieldPath string RequestBodyFields []protoreflect.FieldDescriptor ResponseBodyFieldPath string ResponseBodyFields []protoreflect.FieldDescriptor Vars []RouteTargetVar }
type RouteTargetVar ¶
type RouteTargetVar struct {
// contains filtered or unexported fields
}
type RouteTargetVarMatch ¶
type RouteTargetVarMatch struct { Fields []protoreflect.FieldDescriptor Value string Name string }
type RouteTrie ¶
type RouteTrie struct {
// contains filtered or unexported fields
}
RouteTrie is a prefix trie of valid REST URI paths to route targets. It supports evaluation of variables as the HttpPath is matched, for interpolating parts of the URI HttpPath into an RPC request field. The map is keyed by the HttpPath component that corresponds to a given node.
func NewRouteTrie ¶
func NewRouteTrie() *RouteTrie
func (*RouteTrie) AddRoute ¶
func (t *RouteTrie) AddRoute(grpcMethod string, mth protoreflect.MethodDescriptor) error
func (*RouteTrie) GetRouteMethods ¶
func (t *RouteTrie) GetRouteMethods() []*RouteTarget
func (*RouteTrie) Match ¶
func (t *RouteTrie) Match(uriPath, httpMethod string) (*RouteTarget, []RouteTargetVarMatch, RouteMethods)
Click to show internal directories.
Click to hide internal directories.