Documentation
¶
Index ¶
- Variables
- func Foreach[T any](data []T, fn func(key int, value T) bool) *struct{}
- type BaseComponent
- type BaseLayout
- func (l *BaseLayout) Content() Renderer
- func (l *BaseLayout) Data() []byte
- func (l *BaseLayout) Layout() Renderer
- func (l *BaseLayout) Render(b *Builder) *Builder
- func (l *BaseLayout) SetContent(content Renderer) Renderer
- func (l *BaseLayout) SetData(data []byte) Renderer
- func (l *BaseLayout) SetLayout(layout Renderer) Renderer
- type BaseView
- type Builder
- func (b *Builder) Attr(vals ...string) string
- func (b *Builder) Bytes() []byte
- func (b *Builder) Children(tags ...any) *Builder
- func (b *Builder) ChildrenInline(tags ...any) *Builder
- func (b *Builder) Class(vals ...string) string
- func (b *Builder) Close()
- func (b *Builder) Document(tags ...any) *Builder
- func (b *Builder) Foreach(data []byte, path string, fn func(key, value gjson.Result)) *struct{}
- func (b *Builder) GetBool(data []byte, path string) bool
- func (b *Builder) GetString(data []byte, path string) string
- func (b *Builder) HTML(tokens ...string) *Builder
- func (b *Builder) HTMLInline(tokens ...string) *Builder
- func (b *Builder) If(expression bool, s string) string
- func (b *Builder) IfFunc(expression bool, fn func()) *struct{}
- func (b *Builder) SetData(data []byte, path string, value interface{}) []byte
- func (b *Builder) String() string
- func (b *Builder) Tag(tag string, attrs ...string) *Builder
- func (b *Builder) TagInline(tag string, attrs ...string) *Builder
- func (b *Builder) Text(text string) *Builder
- func (b *Builder) TextInline(text string) *Builder
- func (b *Builder) Void() *Builder
- func (b *Builder) WriteString(s ...string) *struct{}
- type BuilderFn
- type Renderer
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Indent = ` `
)
Functions ¶
Types ¶
type BaseComponent ¶
type BaseComponent struct{}
type BaseLayout ¶
type BaseLayout struct {
// contains filtered or unexported fields
}
func (*BaseLayout) Content ¶
func (l *BaseLayout) Content() Renderer
func (*BaseLayout) Data ¶
func (l *BaseLayout) Data() []byte
func (*BaseLayout) Layout ¶
func (l *BaseLayout) Layout() Renderer
func (*BaseLayout) Render ¶
func (l *BaseLayout) Render(b *Builder) *Builder
func (*BaseLayout) SetContent ¶
func (l *BaseLayout) SetContent(content Renderer) Renderer
func (*BaseLayout) SetData ¶
func (l *BaseLayout) SetData(data []byte) Renderer
func (*BaseLayout) SetLayout ¶
func (l *BaseLayout) SetLayout(layout Renderer) Renderer
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder() *Builder
NewBuilder constructs *Builder provided 'data' argument is valid JSON
func (*Builder) ChildrenInline ¶
ChildrenInline builds inline child elements
func (*Builder) Foreach ¶
Foreach extracts array from JSON data for provided 'path' and executes 'fn' for each array member
func (*Builder) HTMLInline ¶
HTMLInline writes raw strings inline - not sanitized HTML
func (*Builder) TextInline ¶
TextInline writes sanitized text inline
func (*Builder) WriteString ¶
WriteString returns string form Buffer
Click to show internal directories.
Click to hide internal directories.