Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeError ¶
ServeError writes JSON error to response output stream.
Types ¶
type Auth ¶
type Auth interface {
// IsAuthenticated checks if request is performed with all needed authorization credentials.
IsAuthenticated(ctx context.Context, r *http.Request, isCookieAuth, isKeyAuth bool) (context.Context, error)
// RemoveAuthCookie indicates to the client that the authentication cookie should be removed.
RemoveAuthCookie(w http.ResponseWriter)
}
Auth exposes methods to control authentication process for each endpoint.
type CORS ¶ added in v1.134.1
type CORS interface {
// Handle sets the necessary CORS headers for the request and checks if the request is an OPTIONS preflight request.
Handle(w http.ResponseWriter, r *http.Request) bool
}
CORS exposes methods to control CORS (Cross-Origin Resource Sharing) for each endpoint.
Click to show internal directories.
Click to hide internal directories.