Documentation
¶
Index ¶
- func EmptyWrap(rw *RW, c templ.Component) templ.Component
- func NewComponent(handler ComponentHandler) *component
- func NewRequestValidator() *requestValidator
- func NoWhiteSpace(s string) error
- func RequireInt(str string) error
- func TryValidate()
- func UsernameValidator(value string, validators ...StringValidatorFunc) *stringValidator
- type Catcher
- type Component
- type ComponentErrCatcher
- type ComponentFunc
- type ComponentHandler
- type ComponentWrapper
- type Handler
- type HandlerFunc
- type HyperGo
- type Middleware
- type Num
- type Pill
- type PrimitiveMap
- type RW
- func (rw *RW) Boosted() bool
- func (rw *RW) CurrentUrl() *url.URL
- func (rw *RW) ExecutedScripts() []string
- func (rw *RW) IsHistoryRestoreRequest() bool
- func (rw *RW) IsHxRequest() bool
- func (rw *RW) Location(url string)
- func (rw *RW) PathHasPrefix(subPath string) bool
- func (rw *RW) Prompt() string
- func (rw *RW) Redirect(location string)
- func (rw *RW) Refresh()
- func (rw *RW) ReplaceUrl(url string)
- func (rw *RW) Reselect(target string)
- func (rw *RW) Reswap(swapMethod string)
- func (rw *RW) Retarget(target string)
- func (rw *RW) StripPrefix(prefix string)
- func (rw *RW) Target() string
- func (rw *RW) TriggerId() string
- func (rw *RW) TriggerName() string
- type RequestValidator
- type Route
- type Router
- func (router *Router) Delete(path string, h HandlerFunc) *Router
- func (router *Router) FullPath() string
- func (router *Router) Get(path string, h HandlerFunc) *Router
- func (router *Router) GetComponent(path string, c ComponentFunc) ComponentFunc
- func (router *Router) Patch(path string, h HandlerFunc) *Router
- func (router *Router) Post(path string, h HandlerFunc) *Router
- func (router *Router) Put(path string, h HandlerFunc) *Router
- func (router *Router) SetTarget(target string)
- func (router *Router) SubRouter(path string, subrouter *Router)
- func (router *Router) Use(m Middleware)
- func (router *Router) Wrap(w ComponentWrapper) *Router
- type Search
- type StringValidator
- type StringValidatorFunc
- type User
- type ValidatedPrimitive
- type WrapCatcher
- type WrapFunc
- type Wrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewComponent ¶
func NewComponent(handler ComponentHandler) *component
func NewRequestValidator ¶
func NewRequestValidator() *requestValidator
func NoWhiteSpace ¶
func RequireInt ¶
func TryValidate ¶
func TryValidate()
func UsernameValidator ¶
func UsernameValidator(value string, validators ...StringValidatorFunc) *stringValidator
Types ¶
type Component ¶
type Component interface {
Catch(catcher ComponentErrCatcher) Component
// contains filtered or unexported methods
}
type ComponentErrCatcher ¶
type ComponentFunc ¶
func SimpleComponent ¶
func SimpleComponent(fn func() templ.Component) ComponentFunc
type ComponentHandler ¶
func SimpleHandler ¶
func SimpleHandler(fn func() templ.Component) ComponentHandler
type ComponentWrapper ¶
func SimpleWrapper ¶
func SimpleWrapper(fn func(c templ.Component) templ.Component) ComponentWrapper
type Handler ¶
type Handler interface {
Catch(catcher ...Catcher) Handler
HandleFunc() HandlerFunc
// contains filtered or unexported methods
}
func NewHandler ¶
type HandlerFunc ¶
type HandlerFunc func(rw *RW)
type Middleware ¶
type Middleware func(h HandlerFunc) HandlerFunc
type Pill ¶
type Pill int
const ( Placebo Pill = iota Aspirin Ibuprofen Paracetamol Acetaminophen = Paracetamol )
type PrimitiveMap ¶
type PrimitiveMap map[string]ValidatedPrimitive
type RW ¶
type RW struct {
http.ResponseWriter
*http.Request
// contains filtered or unexported fields
}
func (*RW) CurrentUrl ¶
func (*RW) IsHistoryRestoreRequest ¶
func (*RW) IsHxRequest ¶
func (*RW) ReplaceUrl ¶
func (*RW) StripPrefix ¶
func (*RW) TriggerName ¶
type RequestValidator ¶
type RequestValidator interface {
Validate(req *http.Request) (map[string]ValidatedPrimitive, []error)
}
type Route ¶
type Route interface {
Handler() http.HandlerFunc
Use(m Middleware)
PrependMiddleware(m ...Middleware)
FullPath() string
}
type Router ¶
type Router struct {
Parent *Router
Path string
Routes []Route
Middleware []Middleware
SubRouters []*Router
Wrapper ComponentWrapper
Target string
}
func (*Router) GetComponent ¶
func (router *Router) GetComponent(path string, c ComponentFunc) ComponentFunc
func (*Router) Use ¶
func (router *Router) Use(m Middleware)
func (*Router) Wrap ¶
func (router *Router) Wrap(w ComponentWrapper) *Router
type StringValidator ¶
type StringValidator interface {
Validate(s string) []error
Use(s ...StringValidatorFunc) StringValidator
}
type StringValidatorFunc ¶
func RequireMaxLen ¶
func RequireMaxLen(maxLen int) StringValidatorFunc
func RequireMinLen ¶
func RequireMinLen(minLength int) StringValidatorFunc
type ValidatedPrimitive ¶
type WrapCatcher ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
app
command
|
|
|
generators/stringer
command
Stringer is a tool to automate the creation of methods that satisfy the fmt.Stringer interface.
|
Stringer is a tool to automate the creation of methods that satisfy the fmt.Stringer interface. |
|
templ: version: v0.3.857
|
templ: version: v0.3.857 |
Click to show internal directories.
Click to hide internal directories.