Documentation ¶
Index ¶
- func Age(c *Context, age int64)
- func EndTotalTimer(c *Context)
- func GetAndLogErrResponseDetails(c *Context, err error) (int, string)
- func GetId(c *Context, name string) sharedTypes.UUID
- func ListenAndServe(server Server, addr string) error
- func ListenAndServeEach(do func(func() error), server Server, each []string)
- func MustParseJSON(dst interface{}, c *Context) bool
- func ParseAndValidateId(c *Context, name string) (sharedTypes.UUID, error)
- func ProcessFileUpload(d *UploadDetails, c *Context, memoryLimit int64) bool
- func Redirect(c *Context, target string)
- func Respond(c *Context, code int, body interface{}, err error)
- func RespondErr(c *Context, err error)
- func RespondPlain(c *Context, status int, body string)
- func RespondWithIndent(c *Context, code int, body interface{}, err error)
- func TimeStage(c *Context, label string) func()
- type CORSOptions
- type Context
- type HandlerFunc
- type JWT
- type JWTHTTPHandler
- type MiddlewareFunc
- type Router
- func (r *Router) DELETE(endpoint string, f HandlerFunc)
- func (r *Router) GET(endpoint string, f HandlerFunc)
- func (r *Router) Group(partial string) *Router
- func (r *Router) HEAD(endpoint string, f HandlerFunc)
- func (r *Router) NoRoute(f HandlerFunc)
- func (r *Router) POST(endpoint string, f HandlerFunc)
- func (r *Router) PUT(endpoint string, f HandlerFunc)
- func (r *Router) Use(fns ...MiddlewareFunc)
- type RouterOptions
- type Server
- type UploadDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EndTotalTimer ¶
func EndTotalTimer(c *Context)
func ListenAndServe ¶
func ListenAndServeEach ¶
func MustParseJSON ¶
func ParseAndValidateId ¶
func ParseAndValidateId(c *Context, name string) (sharedTypes.UUID, error)
func ProcessFileUpload ¶
func ProcessFileUpload(d *UploadDetails, c *Context, memoryLimit int64) bool
func RespondErr ¶
func RespondPlain ¶
func RespondWithIndent ¶
Types ¶
type CORSOptions ¶
type Context ¶
type Context struct { Writer http.ResponseWriter Request *http.Request // contains filtered or unexported fields }
type HandlerFunc ¶
type HandlerFunc func(c *Context)
func (HandlerFunc) ServeHTTP ¶
func (f HandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type JWTHTTPHandler ¶
type JWTHTTPHandler[T JWT] struct { // contains filtered or unexported fields }
func NewJWTHandler ¶
func NewJWTHandler[T JWT](handler *jwtHandler.JWTHandler[T]) *JWTHTTPHandler[T]
func (*JWTHTTPHandler[T]) Middleware ¶
func (h *JWTHTTPHandler[T]) Middleware() MiddlewareFunc
type MiddlewareFunc ¶
type MiddlewareFunc func(next HandlerFunc) HandlerFunc
func CORS ¶
func CORS(options CORSOptions) MiddlewareFunc
func ValidateAndSetId ¶
func ValidateAndSetId(name string) MiddlewareFunc
func ValidateAndSetIdZeroOK ¶
func ValidateAndSetIdZeroOK(name string) MiddlewareFunc
type Router ¶
func NewRouter ¶
func NewRouter(options *RouterOptions) *Router
func (*Router) DELETE ¶
func (r *Router) DELETE(endpoint string, f HandlerFunc)
func (*Router) GET ¶
func (r *Router) GET(endpoint string, f HandlerFunc)
func (*Router) HEAD ¶
func (r *Router) HEAD(endpoint string, f HandlerFunc)
func (*Router) NoRoute ¶
func (r *Router) NoRoute(f HandlerFunc)
func (*Router) POST ¶
func (r *Router) POST(endpoint string, f HandlerFunc)
func (*Router) PUT ¶
func (r *Router) PUT(endpoint string, f HandlerFunc)
func (*Router) Use ¶
func (r *Router) Use(fns ...MiddlewareFunc)
type RouterOptions ¶
type RouterOptions struct {
Ready func() bool
}
type UploadDetails ¶
type UploadDetails struct { File multipart.File FileName sharedTypes.Filename Size int64 // contains filtered or unexported fields }
func (*UploadDetails) Cleanup ¶
func (d *UploadDetails) Cleanup()
Click to show internal directories.
Click to hide internal directories.