Documentation
¶
Overview ¶
Package internal implements internal functionality for the proxy client.
Index ¶
- Variables
- func NewProxyHandler(operation *schema.RelyProxyOperation, ...) (schema.RelyProxyHandler, error)
- func RegisterProxyHandler(proxyType schema.RelyProxyType, constructor schema.NewRelyProxyHandlerFunc)
- func ValidateOperations(pair *orderedmap.Pair[string, *schema.RelyProxyPathItem]) error
- type InsertRouteOptions
- type MetadataValidationError
- type Node
- type Route
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnsupportedProxyType = errors.New("unsupported proxy type") 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") ErrDuplicatedParamKey = errors.New("routing pattern contains duplicate param key") ErrInvalidRegexpPatternParamInRoute = errors.New("invalid regexp pattern in route param") ErrReplaceMissingChildNode = errors.New("replacing missing child node") )
Functions ¶
func NewProxyHandler ¶
func NewProxyHandler( operation *schema.RelyProxyOperation, options *schema.NewRelyProxyHandlerOptions, ) (schema.RelyProxyHandler, error)
NewProxyHandler creates a proxy handler by type.
func RegisterProxyHandler ¶
func RegisterProxyHandler( proxyType schema.RelyProxyType, constructor schema.NewRelyProxyHandlerFunc, )
RegisterProxyHandler registers the handler to the global registry.
func ValidateOperations ¶
func ValidateOperations(pair *orderedmap.Pair[string, *schema.RelyProxyPathItem]) error
ValidateOperations validate operations of a route.
Types ¶
type InsertRouteOptions ¶
type InsertRouteOptions struct {
GetEnv goenvconf.GetEnvFunc
}
InsertRouteOptions represents options for inserting routes.
type MetadataValidationError ¶
type MetadataValidationError struct {
Path string `json:"path"`
Method string `json:"method"`
Message string `json:"message"`
Details map[string]any `json:"details,omitempty"`
}
MetadataValidationError represents the error structure of the metadata validation error.
func (MetadataValidationError) Error ¶
func (mve MetadataValidationError) Error() string
Error implements the error interface.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node presents the route tree to organize the recursive route structure. Inspired by Chi router
func (*Node) InsertRoute ¶
func (n *Node) InsertRoute( pattern string, operations *schema.RelyProxyPathItem, options *InsertRouteOptions, ) (*Node, error)
Click to show internal directories.
Click to hide internal directories.