package
0.0.0-20241030152356-8c950ad76724
Repository: https://github.com/hylarucoder/rocketbase.git
Documentation: pkg.go.dev
# Functions
ActivityLogger middleware takes care to save the request information into the logs database.
EnrichRecord parses the request context and enrich the provided record: - expands relations (if defaultExpands and/or ?expand query param is set) - ensures that the emails of the auth record and its expanded auth relations are visible only for the current logged admin, record owner or record with manage access.
EnrichRecords parses the request context and enriches the provided records: - expands relations (if defaultExpands and/or ?expand query param is set) - ensures that the emails of the auth records and their expanded auth relations are visible only for the current logged admin, record owner or record with manage access.
InitApi creates a configured echo instance with registered system and app specific routes and middlewares.
LoadAuthContext middleware reads the Authorization request header and loads the token related record or admin instance into the request's context.
LoadCollectionContext middleware finds the collection with related path identifier and loads it into the request context.
NewApiError creates and returns new normalized `ApiError` instance.
NewBadRequestError creates and returns 400 `ApiError`.
NewForbiddenError creates and returns 403 `ApiError`.
NewNotFoundError creates and returns 404 `ApiError`.
NewUnauthorizedError creates and returns 401 `ApiError`.
RecordAuthResponse writes standardised json record auth response into the specified request context.
Deprecated: Use RequestInfo instead.
RequestInfo exports cached common request data fields (query, body, logged auth state, etc.) from the provided context.
RequireAdminAuth middleware requires a request to have a valid admin Authorization header.
RequireAdminAuthOnlyIfAny middleware requires a request to have a valid admin Authorization header ONLY if the application has at least 1 existing Admin model.
RequireAdminOrOwnerAuth middleware requires a request to have a valid admin or auth record owner Authorization header set.
RequireAdminOrRecordAuth middleware requires a request to have a valid admin or record Authorization header set.
RequireGuestOnly middleware requires a request to NOT have a valid Authorization header.
RequireRecordAuth middleware requires a request to have a valid record auth Authorization header.
RequireSameContextRecordAuth middleware requires a request to have a valid record Authorization header.
Serve starts a new app web server.
StaticDirectoryHandler is similar to `echo.StaticDirectoryHandler` but without the directory redirect which conflicts with RemoveTrailingSlash middleware.
# Constants
Common request context keys used by the middlewares and api handlers.
Common request context keys used by the middlewares and api handlers.
Common request context keys used by the middlewares and api handlers.
Common request context keys used by the middlewares and api handlers.
No description provided by the author
# Structs
ApiError defines the struct for a basic api error response.
ServeConfig defines a configuration struct for apis.Serve().