Documentation
¶
Index ¶
- func P[T any](v T) *T
- type Generator
- type Handler
- type HandlerInformation
- type HandlerType
- type Information
- type Mux
- func (m *Mux) Description() string
- func (m *Mux) Find(rctx *chi.Context, method, path string) string
- func (m *Mux) Group(fn func(r Router)) Router
- func (m *Mux) Handle(pattern string, h Handler) Route
- func (m *Mux) HandleFunc(pattern string, h http.HandlerFunc) Route
- func (m *Mux) Match(rctx *chi.Context, method, path string) bool
- func (m *Mux) Method(method, pattern string, h Handler) Route
- func (m *Mux) MethodFunc(method, pattern string, h http.HandlerFunc) Route
- func (m *Mux) MethodNotAllowed(h http.HandlerFunc)
- func (m *Mux) Middlewares() chi.Middlewares
- func (m *Mux) Mount(pattern string, h http.Handler)
- func (m *Mux) NotFound(h http.HandlerFunc)
- func (m *Mux) Route(pattern string, fn func(r Router)) Router
- func (m *Mux) Routes() []chi.Route
- func (m *Mux) ServeHTTP(writer http.ResponseWriter, request *http.Request)
- func (m *Mux) Summary() string
- func (m *Mux) Use(middlewares ...func(http.Handler) http.Handler)
- func (m *Mux) With(middlewares ...func(http.Handler) http.Handler) Router
- func (m *Mux) WithDescription(description string) Router
- func (m *Mux) WithDocs(pattern string, generator Generator)
- func (m *Mux) WithSummary(title string) Router
- func (m *Mux) WithSwaggerUI(pattern string, docPattern string, title string, config *swg.Config)
- type Route
- type Router
- type RouterInformation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Generator ¶
func NewGenerator ¶
func NewGenerator() Generator
type Handler ¶
type Handler interface { http.Handler Info() HandlerInformation }
type HandlerInformation ¶
type HandlerInformation interface { Information Input() *HandlerType Output() *HandlerType Hidden() bool }
type HandlerType ¶
func Binary ¶
func Binary(mimeTypes ...string) *HandlerType
func File ¶
func File() *HandlerType
func Json ¶
func Json[T any]() *HandlerType
type Information ¶
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
func (*Mux) Description ¶
func (*Mux) HandleFunc ¶
func (m *Mux) HandleFunc(pattern string, h http.HandlerFunc) Route
func (*Mux) MethodFunc ¶
func (m *Mux) MethodFunc(method, pattern string, h http.HandlerFunc) Route
func (*Mux) MethodNotAllowed ¶
func (m *Mux) MethodNotAllowed(h http.HandlerFunc)
func (*Mux) Middlewares ¶
func (m *Mux) Middlewares() chi.Middlewares
func (*Mux) NotFound ¶
func (m *Mux) NotFound(h http.HandlerFunc)
func (*Mux) WithDescription ¶
func (*Mux) WithSummary ¶
type Route ¶
type Route interface { HandlerInformation WithSummary(summary string) Route WithDescription(description string) Route ForInput(fluent func(typ *HandlerType)) Route ForOutput(fluent func(typ *HandlerType)) Route WithInput(typ *HandlerType) Route WithOutput(typ *HandlerType) Route WithHidden(hidden bool) Route }
type Router ¶
type Router interface { http.Handler chi.Routes // Use appends one or more middlewares onto the Router stack. Use(middlewares ...func(http.Handler) http.Handler) // With adds inline middlewares for an endpoint handler. With(middlewares ...func(http.Handler) http.Handler) Router // Group adds a new inline-Router along the current routing // path, with a fresh middleware stack for the inline-Router. Group(fn func(r Router)) Router // Route mounts a sub-Router along a `pattern“ string. Route(pattern string, fn func(r Router)) Router // Mount attaches another http.Handler along ./pattern/* Mount(pattern string, h http.Handler) // Handle and HandleFunc adds routes for `pattern` that matches // all HTTP methods. Handle(pattern string, h Handler) Route HandleFunc(pattern string, h http.HandlerFunc) Route // Method and MethodFunc adds routes for `pattern` that matches // the `method` HTTP method. Method(method, pattern string, h Handler) Route MethodFunc(method, pattern string, h http.HandlerFunc) Route // NotFound defines a handler to respond whenever a route could // not be found. NotFound(h http.HandlerFunc) // MethodNotAllowed defines a handler to respond whenever a method is // not allowed. MethodNotAllowed(h http.HandlerFunc) WithDocs(pattern string, generator Generator) WithSwaggerUI(pattern string, docPattern string, title string, config *swg.Config) // ++++ Information ++++ RouterInformation WithSummary(summary string) Router WithDescription(description string) Router }
Router consisting of the gotrac routing methods used by chi's Mux, using only the standard net/http.
type RouterInformation ¶
type RouterInformation interface { Information }
Click to show internal directories.
Click to hide internal directories.