Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterResolver ¶
RegisterResolver register resolver factory to registry. This function is called from init() functions in files that define a resolver.
Types ¶
type BaseResolver ¶
type BaseResolver struct{}
BaseResolver contains common logic for checking request prerequisites.
func (*BaseResolver) BuildAPI ¶
func (b *BaseResolver) BuildAPI(req *http.Request, mappingParams []config.MappingParam) (*router.API, error)
type Resolver ¶
type Resolver interface {
// Resolve attempts to create an API configuration from the given HTTP context.
// If the resolver can handle the request, it returns a configured *router.API and a nil error.
// If the resolver is not applicable to this request, it should return (nil, error).
// If an actual error occurs during processing, it should return (nil, error).
Resolve(ctx *contexthttp.HttpContext) (*router.API, error)
}
Resolver defines the interface for resolving an HTTP request to a specific API configuration. It allows for multiple resolution strategies to be implemented and tried in sequence.
func GetResolver ¶
GetResolver dynamically creates a resolver.
Click to show internal directories.
Click to hide internal directories.