Documentation
¶
Overview ¶
Package internal implements internal functionality for the proxy client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrWildcardMustBeLast = errors.New( "wildcard '*' must be the last value in a route. trim trailing text or use a '{param}' instead", ) ErrMissingClosingBracket = errors.New("route param closing delimiter '}' is missing") ErrParamKeyRequired = errors.New("param key must not be empty") ErrDuplicatedParamKey = errors.New("routing pattern contains duplicate param key") ErrInvalidParamPattern = errors.New("invalid param pattern") ErrDuplicatedRoutingPattern = errors.New("routing pattern is duplicated") ErrInvalidRegexpPatternParamInRoute = errors.New("invalid regexp pattern in route param") ErrReplaceMissingChildNode = errors.New("replacing missing child node") )
Functions ¶
This section is empty.
Types ¶
type MethodHandler ¶
type MethodHandler struct {
Operation *oaschema.Operation
Handler proxyhandler.ProxyHandler
}
MethodHandler represents a handler data for a method.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node presents the route tree to organize the recursive route structure.
func (*Node) InsertRoute ¶
func (n *Node) InsertRoute( document *highv3.Document, pattern string, operations *highv3.PathItem, options *proxyhandler.InsertRouteOptions, ) (*Node, error)
InsertRoute parses the route pattern into tree nodes and creates handlers.
type Route ¶
type Route struct {
Pattern string
Method *MethodHandler
ParamValues map[string]any
}
Route holds parameter values from the request path.
func (Route) IsRequestBodyRequired ¶
IsRequestBodyRequired checks if the request body of this route is required.
Click to show internal directories.
Click to hide internal directories.