Versions in this module Expand all Collapse all v0 v0.2.1 Feb 9, 2024 Changes in this version + const FS_ROUTING_BODY_PARAM + const FS_ROUTING_INDEX_MODULE + const FS_ROUTING_METHOD_PARAM + const MAX_PATH_PARAM_COUNT + var ErrAPIAlreadyFinalized = errors.New("API value is already finalized") + var ErrAPIBeingFinalized = errors.New("API value is being finalized") + var ErrAPINotFinalized = errors.New("API value is not finalized") + var ErrEndpointNotFound = errors.New("endpoint not found") + var ErrFailedCreateApiFromOApenpiSpec = errors.New("failed to create API from Open API/Swagger specification") + var ErrOpenAPIV2SpecNotSupported = errors.New(...) + var ErrUnexpectedBodyParamsInCatchAllHandler = errors.New("unexpected request body parmameters in catch-all handler") + var ErrUnexpectedBodyParamsInGETHandler = errors.New("unexpected request body parmameters in GET handler") + var ErrUnexpectedBodyParamsInOPTIONSHandler = errors.New("unexpected request body parmameters in OPTIONS handler") + var ErrUnsupportedMediaTypeinSpec = errors.New("unsupported media type (in spec)") + var FS_ROUTING_METHODS = []string + var METHODS = []string + var METHODS_WITH_NO_BODY = []string + var METHOD_PATTERN = core.NewUnionPattern(utils.MapSlice(METHODS, func(s string) core.Pattern { ... }), nil) + type API struct + func GetFSRoutingServerAPI(ctx *core.Context, dir string, config ServerApiResolutionConfig) (*API, error) + func NewAPI(endpoints map[string]*ApiEndpoint) (*API, error) + func NewEmptyAPI() *API + func (api *API) ForEachHandlerModule(visit HandlerModuleVisitFn) error + func (api *API) GetEndpoint(path string) (*ApiEndpoint, error) + type ApiEndpoint struct + func (e ApiEndpoint) CatchAll() bool + func (e ApiEndpoint) CatchAllHandler() (*core.Module, bool) + func (e ApiEndpoint) GetPathParams(path string) (params PathParams, count int, err error) + func (e ApiEndpoint) Operations() []ApiOperation + func (e ApiEndpoint) PathWithParams() string + type ApiOperation struct + func (op ApiOperation) HandlerModule() (*core.Module, bool) + func (op ApiOperation) HttpMethod() string + func (op ApiOperation) JSONRequestBodyPattern() (core.Pattern, bool) + type EndpointPathSegment struct + Constant string + ParameterName string + type EndpointTreeNode struct + type HandlerModuleVisitFn func(mod *core.Module, endpoint *ApiEndpoint, operation ApiOperation) error + type PathParam struct + Name string + Value string + func (param PathParam) IsSet() bool + type PathParams [5]PathParam + type ServerApiResolutionConfig struct + IgnoreModulesWithErrors bool