Documentation ¶
Overview ¶
Package api is the API server backed by jsonrest-go. It contains routing, handlers, and middleware.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(s *Server) jsonrest.Middleware
AuthMiddleware handles account authentication. If a request isn't authenticated, the endpoint handler is not called.
func PanicRecoveryMiddleware ¶
func PanicRecoveryMiddleware() jsonrest.Middleware
PanicRecoveryMiddleware catches and returns any panics that occur in the endpoint.
Types ¶
type Config ¶
type Config struct { Database *pgxpool.Pool Sessions *session.Service DumpErrors bool // render full error in response }
Config is the server configuration and dependencies.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is an API server.
Click to show internal directories.
Click to hide internal directories.