Documentation
¶
Index ¶
- func Env() string
- func Getenv(name string, def string) string
- func Handler(h HandlerFunc) http.HandlerFunc
- func IsDevelopment() bool
- func IsProduction() bool
- func Setup()
- func UseErrorHandler(h ErrorHandlerFunc)
- func WithAuthentication(config AuthenticationConfig, strict bool) func(http.Handler) http.Handler
- type Auth
- type AuthKey
- type AuthenticationConfig
- type DefaultAuth
- type ErrorHandlerFunc
- type HandlerFunc
- type Kit
- func (kit *Kit) Auth() Auth
- func (kit *Kit) Bytes(status int, b []byte) error
- func (kit *Kit) FormValue(name string) string
- func (kit *Kit) GetSession(name string) *sessions.Session
- func (kit *Kit) Getenv(name string, def string) string
- func (kit *Kit) JSON(status int, v any) error
- func (kit *Kit) Redirect(status int, url string) error
- func (kit *Kit) Render(c templ.Component) error
- func (kit *Kit) Text(status int, msg string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(h HandlerFunc) http.HandlerFunc
func IsDevelopment ¶
func IsDevelopment() bool
func IsProduction ¶
func IsProduction() bool
func Setup ¶
func Setup()
initialize the store here so the environment variables are already initialized. Calling NewCookieStore() from outside of a function scope won't work.
func UseErrorHandler ¶
func UseErrorHandler(h ErrorHandlerFunc)
func WithAuthentication ¶
Types ¶
type AuthenticationConfig ¶
type DefaultAuth ¶
type DefaultAuth struct{}
func (DefaultAuth) Check ¶
func (DefaultAuth) Check() bool
type ErrorHandlerFunc ¶
type HandlerFunc ¶
type Kit ¶
type Kit struct {
Response http.ResponseWriter
Request *http.Request
}
func (*Kit) GetSession ¶
GetSession return a session by its name. GetSession always returns a session even if it does not exist.
Click to show internal directories.
Click to hide internal directories.