# Functions
CreateDatabaseAPI creates a new database interface.
ErrorWithStatus adds the HTTP status code to the error.
ExportEndpoints exports the registered endpoints.
GetAPIRequest returns the API Request of the given http request.
GetEndpointByPath returns the endpoint registered with the given path.
MarshalRecord locks and marshals the given record, additionally adding metadata and returning it as json.
NewLoggingResponseWriter wraps a http.ResponseWriter.
RegisterEndpoint registers a new endpoint.
RegisterHandleFunc registers a handle function with the API endpoint.
RegisterHandler registers a handler with the API endpoint.
RequestLogger is a logging middleware.
SetAuthenticator sets an authenticator function for the API endpoint.
SetDefaultAPIListenAddress sets the default listen address for the API.
TextResponse writes a text response.
WrapInAuthHandler wraps a simple http.HandlerFunc into a handler that exposes the required API permissions for this handler.
# Constants
Config Keys.
Config Keys.
Dynamic declares that the operation requires permission to be processed, but anyone can execute the operation, as it reacts to permissions itself.
MIME Types.
MIME Types.
NotFound declares that the operation does not exist.
NotSupported declares that the operation is not supported.
PermitAdmin declares that the operation may be executed by authenticated third party applications that are categorized as representing an administrator and has broad in access.
PermitAnyone declares that anyone can execute the operation without any authentication.
PermitSelf declares that the operation may only be executed by the software itself and its own (first party) components.
PermitUser declares that the operation may be executed by authenticated third party applications that are categorized as representing a simple user and is limited in access.
# Variables
EnableServer defines if the HTTP server should be started.
ErrAlreadyRegistered is returned when there already is an endpoint with the same path registered.
ErrAPIAccessDeniedMessage should be wrapped by errors returned by AuthenticatorFunc in order to signify a blocked request, including a error message for the user.
API Errors.
API Errors.
ErrInvalidEndpoint is returned when an invalid endpoint is registered.
RequestContextKey is the key used to add the API request to the context.
# Structs
AuthToken represents either a set of required or granted permissions.
DatabaseAPI is a generic database API interface.
DatabaseWebsocketAPI is a database websocket API interface.
Endpoint describes an API Endpoint.
EndpointBridgeRequest holds a bridged request API request.
EndpointBridgeResponse holds a bridged request API response.
HTTPStatusError represents an error with an HTTP status code.
LoggingResponseWriter is a wrapper for http.ResponseWriter for better request logging.
Parameter describes a parameterized variation of an endpoint.
Request is a support struct to pool more request related information.
# Interfaces
AuthenticatedHandler defines the handler interface to specify custom permission for an API handler.
HTTPStatusProvider is an interface for errors to provide a custom HTTP status code.
ModuleHandler specifies the interface for API endpoints that are bound to a module.
# Type aliases
No description provided by the author
AuthenticatorFunc is a function that can be set as the authenticator for the API endpoint.
No description provided by the author
Permission defines an API requests permission.
No description provided by the author
No description provided by the author