Documentation
¶
Index ¶
- Constants
- Variables
- func Boot(r *Swift)
- func BuildAndValidatePath(path string) string
- func HealthCheckHandler(w http.ResponseWriter, r *http.Request)
- func MakeMiddlewareStack(h http.Handler, m []Middleware) http.Handler
- func MiddlewareStack(handler http.Handler, middlewares ...Middleware) http.Handler
- func NotFoundHandler(w http.ResponseWriter, r *http.Request)
- func Prepend[T any](slice []T, elems ...T) []T
- func RecoverMiddleware(next http.Handler) http.Handler
- func ValidateOApiSchemaMiddleware(next http.Handler) http.Handler
- type Context
- type Group
- func (g *Group) Delete(path string, handler http.HandlerFunc) *HandlerValue
- func (g *Group) Get(path string, handler http.HandlerFunc) *HandlerValue
- func (g *Group) Group(path string) *Group
- func (g *Group) Middleware(m ...Middleware) *Group
- func (g *Group) Patch(path string, handler http.HandlerFunc) *HandlerValue
- func (g *Group) Post(path string, handler http.HandlerFunc) *HandlerValue
- func (g *Group) Put(path string, handler http.HandlerFunc) *HandlerValue
- type HandlerValue
- type Middleware
- type StaticServer
- type SwaggerServer
- type Swift
- func (r *Swift) AddCorsMiddleware(f func(next http.Handler) http.Handler)
- func (r *Swift) AddTLS(crt, key string)
- func (r *Swift) ApiPrefix() *Group
- func (r *Swift) Custom404(c func(w http.ResponseWriter))
- func (r *Swift) Custom500(c func(w http.ResponseWriter))
- func (r *Swift) Delete(pth string, handler http.HandlerFunc) *HandlerValue
- func (r *Swift) Get(pth string, handler http.HandlerFunc) *HandlerValue
- func (r *Swift) Group(path string) *Group
- func (r *Swift) Handle(pth string, handler http.Handler)
- func (r *Swift) MakeHandler(m, path string, handler http.HandlerFunc, group *Group) *HandlerValue
- func (r *Swift) Middleware(m ...Middleware)
- func (r *Swift) OApiValidator(pathToSchema string)
- func (r *Swift) OnBoot(f func())
- func (r *Swift) Patch(pth string, handler http.HandlerFunc) *HandlerValue
- func (r *Swift) Post(pth string, handler http.HandlerFunc) *HandlerValue
- func (r *Swift) Put(pth string, handler http.HandlerFunc) *HandlerValue
- func (r *Swift) RootStaticServer(staticDir string, spa bool)
- func (r *Swift) Serve(host, port string)
- func (r *Swift) SetApiPrefix(prefix string)
- func (r *Swift) SwaggerServe(serve bool)
- func (r *Swift) SwaggerStaticServer(staticDir, path string)
- type TLS
Constants ¶
View Source
const (
DEV_FRONTEND_PROXY = "DEV_FRONTEND_PROXY"
)
Variables ¶
View Source
var BuiltInMiddlewares = []Middleware{RecoverMiddleware}
View Source
var ContextValue = Context{ // contains filtered or unexported fields }
Functions ¶
func BuildAndValidatePath ¶
func HealthCheckHandler ¶
func HealthCheckHandler(w http.ResponseWriter, r *http.Request)
func MakeMiddlewareStack ¶
func MakeMiddlewareStack(h http.Handler, m []Middleware) http.Handler
func MiddlewareStack ¶
func MiddlewareStack(handler http.Handler, middlewares ...Middleware) http.Handler
func NotFoundHandler ¶
func NotFoundHandler(w http.ResponseWriter, r *http.Request)
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func GetContext ¶
func GetContext() *Context
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) Delete ¶
func (g *Group) Delete(path string, handler http.HandlerFunc) *HandlerValue
func (*Group) Get ¶
func (g *Group) Get(path string, handler http.HandlerFunc) *HandlerValue
func (*Group) Middleware ¶
func (g *Group) Middleware(m ...Middleware) *Group
func (*Group) Patch ¶
func (g *Group) Patch(path string, handler http.HandlerFunc) *HandlerValue
func (*Group) Post ¶
func (g *Group) Post(path string, handler http.HandlerFunc) *HandlerValue
func (*Group) Put ¶
func (g *Group) Put(path string, handler http.HandlerFunc) *HandlerValue
type HandlerValue ¶
type HandlerValue struct {
// contains filtered or unexported fields
}
func (*HandlerValue) Middleware ¶
func (h *HandlerValue) Middleware(m ...Middleware)
type StaticServer ¶ added in v0.2.0
type StaticServer struct {
// contains filtered or unexported fields
}
type SwaggerServer ¶
type SwaggerServer struct {
// contains filtered or unexported fields
}
type Swift ¶
type Swift struct {
// contains filtered or unexported fields
}
func (*Swift) AddCorsMiddleware ¶ added in v0.2.2
func (*Swift) Custom404 ¶
func (r *Swift) Custom404(c func(w http.ResponseWriter))
func (*Swift) Custom500 ¶
func (r *Swift) Custom500(c func(w http.ResponseWriter))
func (*Swift) Delete ¶
func (r *Swift) Delete(pth string, handler http.HandlerFunc) *HandlerValue
func (*Swift) Get ¶
func (r *Swift) Get(pth string, handler http.HandlerFunc) *HandlerValue
func (*Swift) MakeHandler ¶
func (r *Swift) MakeHandler(m, path string, handler http.HandlerFunc, group *Group) *HandlerValue
func (*Swift) Middleware ¶
func (r *Swift) Middleware(m ...Middleware)
func (*Swift) OApiValidator ¶
func (*Swift) Patch ¶
func (r *Swift) Patch(pth string, handler http.HandlerFunc) *HandlerValue
func (*Swift) Post ¶
func (r *Swift) Post(pth string, handler http.HandlerFunc) *HandlerValue
func (*Swift) Put ¶
func (r *Swift) Put(pth string, handler http.HandlerFunc) *HandlerValue
func (*Swift) RootStaticServer ¶ added in v0.2.0
func (*Swift) SetApiPrefix ¶ added in v0.2.0
func (*Swift) SwaggerServe ¶
func (*Swift) SwaggerStaticServer ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.