Documentation
¶
Index ¶
- Constants
- Variables
- func BodyAsCSS(req *http.Request, res *string) error
- func BodyAsHTML(req *http.Request, res *string) error
- func BodyAsJSON(req *http.Request, objref any) error
- func BodyAsJavascript(req *http.Request, res *string) error
- func BodyAsText(req *http.Request, res *string) error
- func BodyAsXML(req *http.Request, objref any) error
- func CheckRoute[R routeCheck[R]](r R) bool
- func GetContentFromRequest(req *http.Request, content Content) error
- func GetPaginationHeader(r *http.Request, count, limit, page *int) error
- func NewPath(path string, args ...Argument) string
- func NewRequest(method string, path string, body Content, _args ...Argument) (*http.Request, error)
- func NewURL(path string, _args ...Argument) string
- func PutPathArgsToCtx(req *http.Request, _args ...Argument) *http.Request
- func ReadFromBody(req *http.Request, content Content) error
- func ServeContent(c Content, rw http.ResponseWriter) error
- func SetPaginationHeader(rw http.ResponseWriter, count, limit, page int)
- func SplitArg[C ArgValueTypesCore](argVal string, val *value.Var[[]C]) (err error)
- func StringToA[T ArgValueTypes](s string) (T, error)
- func StringsToA[T ArgValueTypesCore](s []string) ([]T, error)
- type Arg
- type ArgScanner
- type ArgSource
- type ArgValueTypes
- type ArgValueTypesCore
- type Argument
- type Arguments
- type CSS
- type Content
- type Contexter
- type CookieArg
- func (b CookieArg) IsRequired() bool
- func (b CookieArg) IsSet() bool
- func (q CookieArg[T]) New() *CookieArg[T]
- func (q *CookieArg[T]) ReadValue(req *http.Request)
- func (q *CookieArg[T]) Set(s T) *CookieArg[T]
- func (b *CookieArg) SetName(name string)
- func (b CookieArg) Source() ArgSource
- func (b *CookieArg) VarValue() value.Value
- type CoreContext
- func (m *CoreContext) BodyAsCSS(res *string) error
- func (m *CoreContext) BodyAsHTML(res *string) error
- func (m *CoreContext) BodyAsJSON(object_ref any) error
- func (m *CoreContext) BodyAsJavascript(res *string) error
- func (m *CoreContext) BodyAsText(res *string) error
- func (m *CoreContext) BodyAsXML(object_ref any) error
- func (m *CoreContext) GetPaginationHeader(count, limit, page *int) error
- func (c *CoreContext) Header() http.Header
- func (e *CoreContext) HxRefreshOrRedirect(url string) error
- func (e *CoreContext) HxWantsPartial() bool
- func (e *CoreContext) IsHxBoosted() bool
- func (e *CoreContext) IsHxHistoryRestoreRequest() bool
- func (e *CoreContext) IsHxRequest() bool
- func (c *CoreContext) Log(msg string)
- func (c *CoreContext) LogErr(err error)
- func (m *CoreContext) MovedPermanently(url string) error
- func (m *CoreContext) MovedTemporary(url string) error
- func (m *CoreContext) Redirect(url string) error
- func (e *CoreContext) Request() *http.Request
- func (e *CoreContext) ResponseWriter() http.ResponseWriter
- func (e *CoreContext) Route() Route
- func (c *CoreContext) SendArgErrs(targets ...Argument) (hadErrors bool)
- func (m *CoreContext) SendCSS(data string) error
- func (c *CoreContext) SendErr(err error) (hadErrors bool)
- func (c *CoreContext) SendErrForbidden()
- func (c *CoreContext) SendErrInvalidData(msg string)
- func (c *CoreContext) SendErrNotFound(msg string)
- func (c *CoreContext) SendErrorMap(m map[string]string) bool
- func (c *CoreContext) SendFormErrs(generalErr error, formvals ...value.Value) (hadErrors bool)
- func (m *CoreContext) SendHTML(data any) error
- func (e *CoreContext) SendHxRefresh() error
- func (e *CoreContext) SendHxTrigger(what string) error
- func (m *CoreContext) SendJSON(data any) error
- func (m *CoreContext) SendJavaScript(data string) error
- func (m *CoreContext) SendText(data string) error
- func (m *CoreContext) SendXML(data any) error
- func (m *CoreContext) SetHeader(key, value string)
- func (m *CoreContext) SetPaginationHeader(count, limit, page int)
- func (m *CoreContext) Status(code int) error
- func (m *CoreContext) StatusHtmxCancelPolling() error
- func (m *CoreContext) StatusNotFound() error
- func (m *CoreContext) StatusOK() error
- func (c *CoreContext) Write(bt []byte) (int, error)
- func (c *CoreContext) WriteHeader(statusCode int)
- type FormArg
- func (b FormArg) IsRequired() bool
- func (b FormArg) IsSet() bool
- func (q FormArg[T]) New() *FormArg[T]
- func (q FormArg[T]) Position() FormArgPos[T]
- func (q *FormArg[T]) ReadValue(req *http.Request)
- func (q *FormArg[T]) Set(s T) *FormArg[T]
- func (b *FormArg) SetName(name string)
- func (b FormArg) Source() ArgSource
- func (b *FormArg) VarValue() value.Value
- type FormArgPos
- func (q *FormArgPos[T]) Field() string
- func (b FormArgPos) IsRequired() bool
- func (b FormArgPos) IsSet() bool
- func (q *FormArgPos[T]) Name() string
- func (q *FormArgPos[T]) Set(v T) *FormArgPos[T]
- func (b *FormArgPos) SetName(name string)
- func (b FormArgPos) Source() ArgSource
- func (q *FormArgPos[T]) String() string
- func (b *FormArgPos) VarValue() value.Value
- func (q *FormArgPos[T]) WriteTo(wr io.Writer) (int64, error)
- type HTML
- type HandlerFunc
- type HeaderArg
- func (b HeaderArg) IsRequired() bool
- func (b HeaderArg) IsSet() bool
- func (q HeaderArg[T]) New() *HeaderArg[T]
- func (q *HeaderArg[T]) ReadValue(req *http.Request)
- func (q *HeaderArg[T]) Set(s T) *HeaderArg[T]
- func (b *HeaderArg) SetName(name string)
- func (b HeaderArg) Source() ArgSource
- func (b *HeaderArg) VarValue() value.Value
- type JSON
- type JavaScript
- type Link
- func (c Link) AHref() *html.Element
- func (c Link) Button() *html.Element
- func (c Link) Form() *html.Element
- func (c Link) HxApply(el *html.Element) *html.Element
- func (c Link) IsGET() bool
- func (c Link) IsHx() bool
- func (c Link) Method() string
- func (c *Link) SetHx() *Link
- func (c *Link) SetHxNoPushURL() *Link
- func (c *Link) SetHxPushURL() *Link
- func (c *Link) SetHxSwap(swap string) *Link
- func (c *Link) SetHxTarget(targetSelector string) *Link
- func (c *Link) SetHxTrigger(trigger string) *Link
- func (c *Link) SetLabel(name string) *Link
- type PathArg
- func (b PathArg) IsRequired() bool
- func (b PathArg) IsSet() bool
- func (q PathArg[T]) New() *PathArg[T]
- func (q *PathArg[T]) ReadValue(req *http.Request)
- func (q *PathArg[T]) Set(s T) *PathArg[T]
- func (b *PathArg) SetName(name string)
- func (b PathArg) Source() ArgSource
- func (b *PathArg) VarValue() value.Value
- type QueryArg
- func (b QueryArg) IsRequired() bool
- func (b QueryArg) IsSet() bool
- func (q QueryArg[T]) New() *QueryArg[T]
- func (q *QueryArg[T]) ReadValue(req *http.Request)
- func (q *QueryArg[T]) Set(s T) *QueryArg[T]
- func (b *QueryArg) SetName(name string)
- func (b QueryArg) Source() ArgSource
- func (b *QueryArg) VarValue() value.Value
- type Route
- type RouteHandler
- func (r *RouteHandler[T]) Args() []Arg
- func (r *RouteHandler[T]) Call(payload Content, _args ...Argument) (*http.Response, error)
- func (r *RouteHandler[T]) CallWithHeader(payload Content, headers http.Header, _args ...Argument) (*http.Response, error)
- func (r *RouteHandler[T]) Do(fn func(ctx T)) *RouteHandler[T]
- func (r *RouteHandler[T]) GetContent(response Content, args ...Argument) error
- func (r *RouteHandler[T]) GetContentWithPlayload(payload Content, response Content, args ...Argument) error
- func (r *RouteHandler[T]) HasHandler() bool
- func (r *RouteHandler[T]) HxCall(payload Content, _args ...Argument) (*http.Response, error)
- func (r *RouteHandler[T]) HxGetContent(response Content, args ...Argument) error
- func (r *RouteHandler[T]) HxGetContentWithPlayload(payload Content, response Content, args ...Argument) error
- func (r *RouteHandler[T]) HxMustCall(payload Content, args ...Argument) *http.Response
- func (r *RouteHandler[T]) Link(argVals ...Argument) *Link
- func (r *RouteHandler[T]) Method() string
- func (r *RouteHandler[T]) Mount(comp *Router[T])
- func (r *RouteHandler[T]) MountPath() string
- func (r *RouteHandler[T]) MustCall(payload Content, args ...Argument) *http.Response
- func (r *RouteHandler[T]) Path() string
- func (r *RouteHandler[T]) Scan(req *http.Request, targets ...Argument)
- func (r *RouteHandler[T]) ServeHTTP(wr http.ResponseWriter, req *http.Request)
- func (r *RouteHandler[T]) URL(argVals ...Argument) string
- func (r *RouteHandler[T]) WithArgs(_args ...Arg) *RouteHandler[T]
- type Router
- func (c *Router[T]) DELETE(localpath string) *RouteHandler[T]
- func (c *Router[T]) GET(localpath string) *RouteHandler[T]
- func (c *Router[T]) HEAD(localpath string) *RouteHandler[T]
- func (c *Router[T]) Mount(rt *router.Router, pathPrefix string)
- func (c *Router[T]) OPTIONS(localpath string) *RouteHandler[T]
- func (c *Router[T]) PATCH(localpath string) *RouteHandler[T]
- func (c *Router[T]) POST(localpath string) *RouteHandler[T]
- func (c *Router[T]) PUT(localpath string) *RouteHandler[T]
- func (c *Router[T]) Path() string
- func (c *Router[T]) SetVerbose() *Router[T]
- func (rt *Router[T]) SubRouter(name string, prefix string) *Router[T]
- func (rt *Router[T]) Use(fn func(next func(T)) func(T)) *Router[T]
- type Text
- type XML
Constants ¶
View Source
const ( HeaderPaginationCount = "Pagination-Count" HeaderPaginationPage = "Pagination-Page" HeaderPaginationLimit = "Pagination-Limit" )
Variables ¶
View Source
var ( SrcFromQuery = ArgSource("FromQuery") SrcFromForm = ArgSource("FromForm") SrcFromPath = ArgSource("FromPath") SrcFromHeader = ArgSource("FromHeader") SrcFromCookie = ArgSource("FromCookie") )
View Source
var ( ErrNotFound = errors.Error("not found: %v") ErrUnexpected = errors.Error("unexpected: %v") ErrInvalidType = errors.Error("invalid type: %T (expected %T)") ErrMissing = errors.Error("missing: %s") ErrForbidden = errors.Error("forbidden: %s") )
View Source
var ( ErrWrongContentType = errors.Error("wrong content type: %s (expected %s)") ErrValidation = errors.Error("validation error: %w") )
View Source
var ( ErrArgNotFound = errors.Error("argument with name %q could not be found") ErrArgExists = errors.Error("argument with name %q already exists") ErrArgMissing = errors.Error("missing argument %q of source %q") ErrArgNotInRequest = errors.Error("argument %q of type %s not in request") ErrArgUnknown = errors.Error("unknown argument %q given") ErrArgInvalidType = errors.Error("invalid type for argument %s: %T (expected %T)") )
View Source
var ( ErrPathArgNotRegistered = errors.Error("path argument %q from path string %q not registered") ErrPathArgRegisteredWithWrongType = errors.Error("path argument %q from path string %q registered with wrong path type (%q)") ErrPathArgRegisteredNotInPath = errors.Error("path argument %q registered, but not inside path string %q") )
View Source
var ( ErrClientRequest = errors.Error("error while making a request as a client: %w") ErrFormArgsAndBody = errors.Error("form arguments (%#v) and a body can't be passed at the same time") ErrBodyNotAllowedForMethod = errors.Error("transmitting a form for method %s is not allowed") )
View Source
var (
ErrFormArg = errors.Error("form argument %q given")
)
View Source
var PaginationHeader = struct { Count HeaderArg[int] Limit HeaderArg[int] Page HeaderArg[int] }{ Count: NewHeaderArgOpt[int](HeaderPaginationCount), Limit: NewHeaderArgOpt[int](HeaderPaginationPage), Page: NewHeaderArgOpt[int](HeaderPaginationLimit), }
Functions ¶
func CheckRoute ¶
func CheckRoute[R routeCheck[R]](r R) bool
the check is done via the routeCheck and this is compilation time
func NewRequest ¶
func ServeContent ¶
func ServeContent(c Content, rw http.ResponseWriter) error
func SetPaginationHeader ¶
func SetPaginationHeader(rw http.ResponseWriter, count, limit, page int)
func SplitArg ¶ added in v0.13.4
func SplitArg[C ArgValueTypesCore](argVal string, val *value.Var[[]C]) (err error)
func StringToA ¶
func StringToA[T ArgValueTypes](s string) (T, error)
func StringsToA ¶ added in v0.13.4
func StringsToA[T ArgValueTypesCore](s []string) ([]T, error)
Types ¶
type ArgScanner ¶
type ArgValueTypes ¶
type ArgValueTypesCore ¶ added in v0.13.4
type Contexter ¶
type Contexter interface { Route() Route Request() *http.Request ResponseWriter() http.ResponseWriter }
type CookieArg ¶
type CookieArg[T ArgValueTypes] struct { // contains filtered or unexported fields }
func NewCookieArg ¶
func NewCookieArg[T ArgValueTypes](name string) CookieArg[T]
func NewCookieArgOpt ¶
func NewCookieArgOpt[T ArgValueTypes](name string) CookieArg[T]
func (CookieArg) IsRequired ¶
func (b CookieArg) IsRequired() bool
type CoreContext ¶
type CoreContext struct { IsHandled bool // the route was already been handled IsHeaderWritten bool Debug bool // debug/development mode // contains filtered or unexported fields }
func NewCoreContext ¶
func NewCoreContext(rt Route, rw http.ResponseWriter, req *http.Request) *CoreContext
func (*CoreContext) BodyAsCSS ¶
func (m *CoreContext) BodyAsCSS(res *string) error
func (*CoreContext) BodyAsHTML ¶
func (m *CoreContext) BodyAsHTML(res *string) error
func (*CoreContext) BodyAsJSON ¶
func (m *CoreContext) BodyAsJSON(object_ref any) error
func (*CoreContext) BodyAsJavascript ¶
func (m *CoreContext) BodyAsJavascript(res *string) error
func (*CoreContext) BodyAsText ¶
func (m *CoreContext) BodyAsText(res *string) error
func (*CoreContext) BodyAsXML ¶
func (m *CoreContext) BodyAsXML(object_ref any) error
func (*CoreContext) GetPaginationHeader ¶
func (m *CoreContext) GetPaginationHeader(count, limit, page *int) error
func (*CoreContext) Header ¶
func (c *CoreContext) Header() http.Header
func (*CoreContext) HxRefreshOrRedirect ¶
func (e *CoreContext) HxRefreshOrRedirect(url string) error
func (*CoreContext) HxWantsPartial ¶
func (e *CoreContext) HxWantsPartial() bool
func (*CoreContext) IsHxBoosted ¶
func (e *CoreContext) IsHxBoosted() bool
func (*CoreContext) IsHxHistoryRestoreRequest ¶
func (e *CoreContext) IsHxHistoryRestoreRequest() bool
func (*CoreContext) IsHxRequest ¶
func (e *CoreContext) IsHxRequest() bool
func (*CoreContext) Log ¶
func (c *CoreContext) Log(msg string)
func (*CoreContext) LogErr ¶
func (c *CoreContext) LogErr(err error)
func (*CoreContext) MovedPermanently ¶
func (m *CoreContext) MovedPermanently(url string) error
func (*CoreContext) MovedTemporary ¶
func (m *CoreContext) MovedTemporary(url string) error
func (*CoreContext) Redirect ¶
func (m *CoreContext) Redirect(url string) error
func (*CoreContext) Request ¶
func (e *CoreContext) Request() *http.Request
func (*CoreContext) ResponseWriter ¶
func (e *CoreContext) ResponseWriter() http.ResponseWriter
func (*CoreContext) Route ¶
func (e *CoreContext) Route() Route
func (*CoreContext) SendArgErrs ¶
func (c *CoreContext) SendArgErrs(targets ...Argument) (hadErrors bool)
func (*CoreContext) SendCSS ¶
func (m *CoreContext) SendCSS(data string) error
func (*CoreContext) SendErr ¶
func (c *CoreContext) SendErr(err error) (hadErrors bool)
func (*CoreContext) SendErrForbidden ¶ added in v0.13.60
func (c *CoreContext) SendErrForbidden()
func (*CoreContext) SendErrInvalidData ¶
func (c *CoreContext) SendErrInvalidData(msg string)
func (*CoreContext) SendErrNotFound ¶
func (c *CoreContext) SendErrNotFound(msg string)
func (*CoreContext) SendErrorMap ¶ added in v0.13.1
func (c *CoreContext) SendErrorMap(m map[string]string) bool
func (*CoreContext) SendFormErrs ¶
func (c *CoreContext) SendFormErrs(generalErr error, formvals ...value.Value) (hadErrors bool)
func (*CoreContext) SendHTML ¶
func (m *CoreContext) SendHTML(data any) error
func (*CoreContext) SendHxRefresh ¶
func (e *CoreContext) SendHxRefresh() error
func (*CoreContext) SendHxTrigger ¶ added in v0.13.60
func (e *CoreContext) SendHxTrigger(what string) error
func (*CoreContext) SendJSON ¶
func (m *CoreContext) SendJSON(data any) error
func (*CoreContext) SendJavaScript ¶
func (m *CoreContext) SendJavaScript(data string) error
func (*CoreContext) SendText ¶
func (m *CoreContext) SendText(data string) error
func (*CoreContext) SendXML ¶
func (m *CoreContext) SendXML(data any) error
func (*CoreContext) SetHeader ¶
func (m *CoreContext) SetHeader(key, value string)
func (*CoreContext) SetPaginationHeader ¶
func (m *CoreContext) SetPaginationHeader(count, limit, page int)
func (*CoreContext) Status ¶
func (m *CoreContext) Status(code int) error
func (*CoreContext) StatusHtmxCancelPolling ¶
func (m *CoreContext) StatusHtmxCancelPolling() error
func (*CoreContext) StatusNotFound ¶
func (m *CoreContext) StatusNotFound() error
func (*CoreContext) StatusOK ¶
func (m *CoreContext) StatusOK() error
func (*CoreContext) WriteHeader ¶
func (c *CoreContext) WriteHeader(statusCode int)
type FormArg ¶
type FormArg[T ArgValueTypes] struct { // contains filtered or unexported fields }
func NewFormArg ¶
func NewFormArg[T ArgValueTypes](name string) FormArg[T]
func NewFormArgOpt ¶
func NewFormArgOpt[T ArgValueTypes](name string) FormArg[T]
func (FormArg) IsRequired ¶
func (b FormArg) IsRequired() bool
func (FormArg[T]) Position ¶ added in v0.13.21
func (q FormArg[T]) Position() FormArgPos[T]
type FormArgPos ¶ added in v0.13.22
type FormArgPos[T ArgValueTypes] struct { FormArg[T] // contains filtered or unexported fields }
func (*FormArgPos[T]) Field ¶ added in v0.13.23
func (q *FormArgPos[T]) Field() string
func (FormArgPos) IsRequired ¶ added in v0.13.22
func (b FormArgPos) IsRequired() bool
func (*FormArgPos[T]) Name ¶ added in v0.13.22
func (q *FormArgPos[T]) Name() string
func (*FormArgPos[T]) Set ¶ added in v0.13.22
func (q *FormArgPos[T]) Set(v T) *FormArgPos[T]
func (*FormArgPos[T]) String ¶ added in v0.13.22
func (q *FormArgPos[T]) String() string
type HandlerFunc ¶
type HandlerFunc[T Contexter] func(T)
type HeaderArg ¶
type HeaderArg[T ArgValueTypes] struct { // contains filtered or unexported fields }
func NewHeaderArg ¶
func NewHeaderArg[T ArgValueTypes](name string) HeaderArg[T]
func NewHeaderArgOpt ¶
func NewHeaderArgOpt[T ArgValueTypes](name string) HeaderArg[T]
func (HeaderArg) IsRequired ¶
func (b HeaderArg) IsRequired() bool
type JavaScript ¶
type JavaScript struct {
Data string
}
func NewJavaScript ¶
func NewJavaScript(data string) *JavaScript
func (JavaScript) ContentType ¶
func (s JavaScript) ContentType() string
type Link ¶
Link is a structure that might be a htmx link or a normal link it might manifest as a href or as a form the constructor or the recipient might set the label, the htmx status or the target. however the recipient (view) decides, if it is to be used as a href or as a form
func NewLinkDELETE ¶ added in v0.13.35
func NewLinkGET ¶ added in v0.13.35
func NewLinkPATCH ¶ added in v0.13.35
func NewLinkPOST ¶ added in v0.13.35
func NewLinkPUT ¶ added in v0.13.35
func (Link) Form ¶ added in v0.13.31
Label is ignored in this case and must be added by the caller, if necessary
func (Link) HxApply ¶ added in v0.13.32
HxApply adds hx properties to the given element and panics, if Link is no HTMX Link. Label is not used in this case and must be applied from the caller
func (*Link) SetHxNoPushURL ¶ added in v0.13.32
func (*Link) SetHxPushURL ¶ added in v0.13.32
func (*Link) SetHxTarget ¶ added in v0.13.32
func (*Link) SetHxTrigger ¶ added in v0.13.32
type PathArg ¶
type PathArg[T ArgValueTypes] struct { // contains filtered or unexported fields }
func NewPathArg ¶
func NewPathArg[T ArgValueTypes](name string) PathArg[T]
func (PathArg) IsRequired ¶
func (b PathArg) IsRequired() bool
type QueryArg ¶
type QueryArg[T ArgValueTypes] struct { // contains filtered or unexported fields }
func NewQueryArg ¶
func NewQueryArg[T ArgValueTypes](name string) QueryArg[T]
func NewQueryArgOpt ¶
func NewQueryArgOpt[T ArgValueTypes](name string) QueryArg[T]
func (QueryArg) IsRequired ¶
func (b QueryArg) IsRequired() bool
type Route ¶
type Route interface { Args() []Arg Method() string URL(argVals ...Argument) string Link(argVals ...Argument) (c *Link) Path() string HasHandler() bool Call(body Content, args ...Argument) (*http.Response, error) MustCall(body Content, args ...Argument) *http.Response GetContent(response Content, args ...Argument) error GetContentWithPlayload(payload Content, response Content, args ...Argument) error HxGetContent(response Content, args ...Argument) error HxGetContentWithPlayload(payload Content, response Content, args ...Argument) error HxCall(payload Content, _args ...Argument) (*http.Response, error) HxMustCall(payload Content, args ...Argument) *http.Response Scan(req *http.Request, targets ...Argument) }
type RouteHandler ¶
type RouteHandler[T Contexter] struct { // contains filtered or unexported fields }
func (*RouteHandler[T]) Args ¶
func (r *RouteHandler[T]) Args() []Arg
func (*RouteHandler[T]) CallWithHeader ¶ added in v0.13.32
func (*RouteHandler[T]) Do ¶
func (r *RouteHandler[T]) Do(fn func(ctx T)) *RouteHandler[T]
func (*RouteHandler[T]) GetContent ¶
func (r *RouteHandler[T]) GetContent(response Content, args ...Argument) error
func (*RouteHandler[T]) GetContentWithPlayload ¶
func (r *RouteHandler[T]) GetContentWithPlayload(payload Content, response Content, args ...Argument) error
func (*RouteHandler[T]) HasHandler ¶
func (r *RouteHandler[T]) HasHandler() bool
func (*RouteHandler[T]) HxGetContent ¶ added in v0.13.32
func (r *RouteHandler[T]) HxGetContent(response Content, args ...Argument) error
func (*RouteHandler[T]) HxGetContentWithPlayload ¶ added in v0.13.32
func (r *RouteHandler[T]) HxGetContentWithPlayload(payload Content, response Content, args ...Argument) error
func (*RouteHandler[T]) HxMustCall ¶ added in v0.13.32
func (r *RouteHandler[T]) HxMustCall(payload Content, args ...Argument) *http.Response
MustCall is like Call and panics on errors
func (*RouteHandler[T]) Link ¶
func (r *RouteHandler[T]) Link(argVals ...Argument) *Link
func (*RouteHandler[T]) Method ¶
func (r *RouteHandler[T]) Method() string
func (*RouteHandler[T]) Mount ¶
func (r *RouteHandler[T]) Mount(comp *Router[T])
func (*RouteHandler[T]) MountPath ¶
func (r *RouteHandler[T]) MountPath() string
func (*RouteHandler[T]) MustCall ¶
func (r *RouteHandler[T]) MustCall(payload Content, args ...Argument) *http.Response
MustCall is like Call and panics on errors
func (*RouteHandler[T]) Path ¶
func (r *RouteHandler[T]) Path() string
func (*RouteHandler[T]) Scan ¶
func (r *RouteHandler[T]) Scan(req *http.Request, targets ...Argument)
func (*RouteHandler[T]) ServeHTTP ¶
func (r *RouteHandler[T]) ServeHTTP(wr http.ResponseWriter, req *http.Request)
func (*RouteHandler[T]) URL ¶
func (r *RouteHandler[T]) URL(argVals ...Argument) string
panics when arg is missing
func (*RouteHandler[T]) WithArgs ¶
func (r *RouteHandler[T]) WithArgs(_args ...Arg) *RouteHandler[T]
type Router ¶
type Router[T Contexter] struct { Name string Routes []*RouteHandler[T] // contains filtered or unexported fields }
func (*Router[T]) DELETE ¶
func (c *Router[T]) DELETE(localpath string) *RouteHandler[T]
func (*Router[T]) GET ¶
func (c *Router[T]) GET(localpath string) *RouteHandler[T]
func (*Router[T]) HEAD ¶
func (c *Router[T]) HEAD(localpath string) *RouteHandler[T]
func (*Router[T]) OPTIONS ¶
func (c *Router[T]) OPTIONS(localpath string) *RouteHandler[T]
func (*Router[T]) PATCH ¶
func (c *Router[T]) PATCH(localpath string) *RouteHandler[T]
func (*Router[T]) POST ¶
func (c *Router[T]) POST(localpath string) *RouteHandler[T]
func (*Router[T]) PUT ¶
func (c *Router[T]) PUT(localpath string) *RouteHandler[T]
func (*Router[T]) SetVerbose ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.