Documentation ¶
Overview ¶
Package api implements a common handler used by the api routes
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
func (*API) HandleRoute ¶
type Handler ¶
type Handler[T any] struct { Config *config.Config Auth *auth.Auth // Handler to handle Auth Methods []string // HTTP methods to allow Scope scopes.Scope ScopeParam func(*http.Request) string Handler func(string, *http.Request) (T, error) // contains filtered or unexported fields }
Handler represents an API handler that returns a REST response. The response is automatically marshaled using T.
Click to show internal directories.
Click to hide internal directories.