Documentation
¶
Index ¶
- Constants
- Variables
- func GetVar[T comparable](c Context, key string, defaultv ...T) T
- type A
- type Abbr
- type Acronym
- type Action
- type Address
- type App
- type AppContext
- type Applet
- type Area
- type Article
- type Aside
- type Attr
- type AttrIf
- type AttrValueMerge
- type Attribute
- type Audio
- type B
- type Base
- type Basefont
- type Bdi
- type Bdo
- type Bgsound
- type Big
- type Blink
- type Blockquote
- type Body
- type Br
- type Button
- type CSSComponent
- type CSSRule
- type CSSSelector
- type Canvas
- type Caption
- type Center
- type Charset
- type Cite
- type Class
- type Code
- type Col
- type Colgroup
- type Command
- type Component
- type CondFunc
- type Context
- type Crossorigin
- type CtxParam
- type Data
- type Datalist
- type Dd
- type Del
- type Details
- type Dfn
- type Dialog
- type Dir
- type Div
- type Dl
- type Doctype
- type Dt
- type Each
- type Elems
- type Em
- type Embed
- type Fieldset
- type Figcaption
- type Figure
- type Font
- type Footer
- type Form
- type FormAction
- type FormMethod
- type FormatBlock
- type Frame
- type Frameset
- type H1
- type H2
- type H3
- type H4
- type H5
- type H6
- type HTML
- type HTMLFormatter
- type HTTPContext
- func (t *HTTPContext) Param(key string) string
- func (t *HTTPContext) Read(buff []byte) (int, error)
- func (t *HTTPContext) Redirect(url string) error
- func (t *HTTPContext) Render(c Component) error
- func (t *HTTPContext) SetVar(key string, value any)
- func (t *HTTPContext) Var(key string) any
- func (t *HTTPContext) With(f func(*HTTPContext)) *HTTPContext
- func (t *HTTPContext) Write(buff []byte) (int, error)
- func (t *HTTPContext) WriteHeader(key string, value string) error
- func (t *HTTPContext) WriteStatus(code int) error
- func (t *HTTPContext) WriteString(s string, args ...any) error
- type Head
- type Header
- type Hr
- type Href
- type I
- type ID
- type If
- type Iframe
- type Img
- type Input
- type Ins
- type Integrity
- type Kbd
- type Keygen
- type Label
- type Legend
- type Li
- type Link
- type Main
- type Map
- type Mark
- type Marquee
- type MemoryContext
- func (t *MemoryContext) Param(key string) string
- func (t *MemoryContext) Read(buff []byte) (int, error)
- func (t *MemoryContext) Redirect(string) error
- func (t *MemoryContext) Render(c Component) error
- func (t *MemoryContext) SetVar(key string, value any)
- func (t *MemoryContext) Var(key string) any
- func (t *MemoryContext) Write(buff []byte) (int, error)
- func (t *MemoryContext) WriteHeader(key string, value string) error
- func (t *MemoryContext) WriteStatus(code int) error
- func (t *MemoryContext) WriteString(s string, args ...any) error
- type Menu
- type Menuitem
- type Meta
- type Meter
- type Method
- type Name
- type Nav
- type Noframes
- type NoopContext
- func (t *NoopContext) Param(string) string
- func (t *NoopContext) Read(buff []byte) (int, error)
- func (t *NoopContext) Redirect(string) error
- func (t *NoopContext) Render(c Component) error
- func (t *NoopContext) SetVar(key string, value any)
- func (t *NoopContext) Var(key string) any
- func (t *NoopContext) Write(buff []byte) (int, error)
- func (t *NoopContext) WriteHeader(key string, value string) error
- func (t *NoopContext) WriteStatus(code int) error
- func (t *NoopContext) WriteString(s string, args ...any) error
- type Noscript
- type Object
- type Ol
- type Optgroup
- type Option
- type Output
- type P
- type Param
- type PhrasingContent
- type Picture
- type Placeholder
- type Pre
- type Progress
- type Q
- type RawHTML
- type Rel
- type RenderFunc
- type Route
- type Rp
- type Rt
- type Ruby
- type S
- type Samp
- type Script
- type Section
- type Select
- type SelfClosing
- type Small
- type Source
- type Span
- type Src
- type Strike
- type Strong
- type Style
- type StyleAttr
- type Sub
- type Summary
- type Sup
- type Svg
- type Table
- type Target
- type Tbody
- type Td
- type Template
- type Text
- type Textarea
- type Tfoot
- type Th
- type Thead
- type Time
- type Title
- type Tr
- type Track
- type Tt
- type Type
- type U
- type Ul
- type Value
- type Var
- type Video
- type Wbr
Constants ¶
View Source
const (
VarIndent = "__indent"
)
Variables ¶
View Source
var ( VarIterItem = "__iteritem" VarHTTPMethod = "__httpmethod" )
View Source
var ( CharsetUTF8 = Charset{"UTF-8"} CorsAnonymous = Crossorigin{"anonymous"} CorsNone = Crossorigin{""} CorsUseCredentials = Crossorigin{"use-credentials"} FormMethodGET = FormMethod{"get"} FormMethodPOST = FormMethod{"post"} MethodGET = Method{"get"} MethodPOST = Method{"post"} RelExternal = Rel{"external"} RelHelp = Rel{"help"} RelLicense = Rel{"license"} RelNext = Rel{"next"} RelNoFollow = Rel{"nofollow"} RelNoOpener = Rel{"noopener"} RelNoReferrer = Rel{"noreferrer"} RelOpener = Rel{"opener"} RelPrev = Rel{"prev"} RelSearch = Rel{"search"} RelStylesheet = Rel{"stylesheet"} TargetBlank = Target{"__blank"} TargetParent = Target{"__parent"} TargetSelf = Target{"__self"} TargetTop = Target{"__top"} TypeButton = Type{"button"} TypeCheckbox = Type{"checkbox"} TypeColor = Type{"color"} TypeDate = Type{"date"} TypeDateTime = Type{"datetime"} TypeDateTimeLocal = Type{"datetime-local"} TypeEmail = Type{"email"} TypeFile = Type{"file"} TypeHidden = Type{"hidden"} TypeImage = Type{"image"} TypeJavascript = Type{"text/javascript"} TypeMonth = Type{"month"} TypeNumber = Type{"number"} TypePassword = Type{"password"} TypeRadio = Type{"radio"} TypeRange = Type{"range"} TypeReset = Type{"reset"} TypeSearch = Type{"search"} TypeSubmit = Type{"submit"} TypeTel = Type{"tel"} TypeText = Type{"text"} TypeTime = Type{"time"} TypeURL = Type{"url"} TypeWeek = Type{"week"} )
Functions ¶
func GetVar ¶
func GetVar[T comparable](c Context, key string, defaultv ...T) T
Types ¶
type AppContext ¶
func NewAppContext ¶
func NewAppContext() *AppContext
func (*AppContext) AddRoute ¶
func (t *AppContext) AddRoute(r Route)
func (*AppContext) ServeHTTP ¶
func (t *AppContext) ServeHTTP(w http.ResponseWriter, r *http.Request)
type AttrValueMerge ¶
type AttrValueMerge interface { Component AttrValueMerge() }
type Blockquote ¶
type Blockquote []Component
type CSSComponent ¶
type CSSComponent interface { Component CSSComponent() }
type CSSRule ¶
type CSSRule struct { AlignItems string BackgroundColor string Color string Display string JustifyContent string Left string Margin string PlaceItems string Position string Top string Transform string Width string }
func (CSSRule) CSSComponent ¶
func (t CSSRule) CSSComponent()
type CSSSelector ¶
func (CSSSelector) CSSComponent ¶
func (t CSSSelector) CSSComponent()
func (CSSSelector) Render ¶
func (t CSSSelector) Render(c Context) error
type Component ¶
func ConvertSlice ¶
type Crossorigin ¶
type Crossorigin []string
func (Crossorigin) Attribute ¶
func (t Crossorigin) Attribute()
func (Crossorigin) Render ¶
func (t Crossorigin) Render(c Context) error
type Figcaption ¶
type Figcaption []Component
type FormAction ¶
type FormAction []string
func (FormAction) AttrValueMerge ¶
func (t FormAction) AttrValueMerge()
func (FormAction) Attribute ¶
func (t FormAction) Attribute()
func (FormAction) Render ¶
func (t FormAction) Render(c Context) error
type FormMethod ¶
type FormMethod []string
func (FormMethod) Attribute ¶
func (t FormMethod) Attribute()
func (FormMethod) Render ¶
func (t FormMethod) Render(c Context) error
type FormatBlock ¶
type FormatBlock interface {
FormatBlock()
}
type HTMLFormatter ¶
type HTMLFormatter struct {
// contains filtered or unexported fields
}
func NewHTMLFormatter ¶
func NewHTMLFormatter(sink io.Writer) *HTMLFormatter
type HTTPContext ¶
type HTTPContext struct {
// contains filtered or unexported fields
}
func NewHTTPContext ¶
func NewHTTPContext() *HTTPContext
func (*HTTPContext) Param ¶
func (t *HTTPContext) Param(key string) string
func (*HTTPContext) Redirect ¶
func (t *HTTPContext) Redirect(url string) error
func (*HTTPContext) Render ¶
func (t *HTTPContext) Render(c Component) error
func (*HTTPContext) SetVar ¶
func (t *HTTPContext) SetVar(key string, value any)
func (*HTTPContext) Var ¶
func (t *HTTPContext) Var(key string) any
func (*HTTPContext) With ¶
func (t *HTTPContext) With(f func(*HTTPContext)) *HTTPContext
func (*HTTPContext) WriteHeader ¶
func (t *HTTPContext) WriteHeader(key string, value string) error
func (*HTTPContext) WriteStatus ¶
func (t *HTTPContext) WriteStatus(code int) error
func (*HTTPContext) WriteString ¶
func (t *HTTPContext) WriteString(s string, args ...any) error
type Link ¶
type Link []Component
func (Link) FormatBlock ¶
func (t Link) FormatBlock()
func (Link) SelfClosing ¶
func (t Link) SelfClosing()
type MemoryContext ¶
type MemoryContext struct { Headers map[string]string Params map[string]string Sink bytes.Buffer Source bytes.Buffer Status int Vars map[string]any }
func NewMemoryContext ¶
func NewMemoryContext() *MemoryContext
func (*MemoryContext) Param ¶
func (t *MemoryContext) Param(key string) string
func (*MemoryContext) Redirect ¶
func (t *MemoryContext) Redirect(string) error
func (*MemoryContext) Render ¶
func (t *MemoryContext) Render(c Component) error
func (*MemoryContext) SetVar ¶
func (t *MemoryContext) SetVar(key string, value any)
func (*MemoryContext) Var ¶
func (t *MemoryContext) Var(key string) any
func (*MemoryContext) WriteHeader ¶
func (t *MemoryContext) WriteHeader(key string, value string) error
func (*MemoryContext) WriteStatus ¶
func (t *MemoryContext) WriteStatus(code int) error
func (*MemoryContext) WriteString ¶
func (t *MemoryContext) WriteString(s string, args ...any) error
type Meta ¶
type Meta []Component
func (Meta) FormatBlock ¶
func (t Meta) FormatBlock()
func (Meta) SelfClosing ¶
func (t Meta) SelfClosing()
type NoopContext ¶
type NoopContext struct{}
func NewNoopContext ¶
func NewNoopContext() *NoopContext
func (*NoopContext) Param ¶
func (t *NoopContext) Param(string) string
func (*NoopContext) Redirect ¶
func (t *NoopContext) Redirect(string) error
func (*NoopContext) Render ¶
func (t *NoopContext) Render(c Component) error
func (*NoopContext) SetVar ¶
func (t *NoopContext) SetVar(key string, value any)
func (*NoopContext) Var ¶
func (t *NoopContext) Var(key string) any
func (*NoopContext) WriteHeader ¶
func (t *NoopContext) WriteHeader(key string, value string) error
func (*NoopContext) WriteStatus ¶
func (t *NoopContext) WriteStatus(code int) error
func (*NoopContext) WriteString ¶
func (t *NoopContext) WriteString(s string, args ...any) error
type PhrasingContent ¶
type PhrasingContent interface { Component PhrasingContent() }
type Placeholder ¶
type Placeholder []string
func (Placeholder) Attribute ¶
func (t Placeholder) Attribute()
func (Placeholder) Render ¶
func (t Placeholder) Render(c Context) error
type RenderFunc ¶
func (RenderFunc) Render ¶
func (t RenderFunc) Render(c Context) error
type SelfClosing ¶
type SelfClosing interface { Component SelfClosing() }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.