templatetrees

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StructuredCollection

type StructuredCollection struct {
	Name   string        `json:"name"`
	Items  []interface{} `json:"items"`
	Fields []string      `json:"fields"`
}

func NewStructuredCollection

func NewStructuredCollection(name string, fields []string) *StructuredCollection

func (*StructuredCollection) Add

func (c *StructuredCollection) Add(item interface{})

func (*StructuredCollection) Render

func (c *StructuredCollection) Render(template string) string

type TemplateTree

type TemplateTree struct {
	// contains filtered or unexported fields
}

func NewTemplateTree

func NewTemplateTree() *TemplateTree

func (*TemplateTree) Add

func (t *TemplateTree) Add(path string, value interface{})

func (*TemplateTree) CarryForward

func (t *TemplateTree) CarryForward(keys []string) map[string]interface{}

func (*TemplateTree) ChildrenAs

func (t *TemplateTree) ChildrenAs(path, delimiter string) string

func (*TemplateTree) Get

func (t *TemplateTree) Get(path string) interface{}

func (*TemplateTree) GetField

func (t *TemplateTree) GetField(key string) interface{}

func (*TemplateTree) Render

func (t *TemplateTree) Render(template string) string

func (*TemplateTree) SetField

func (t *TemplateTree) SetField(key string, value interface{})

type TreeNode

type TreeNode struct {
	Key      string               `json:"key"`
	Value    interface{}          `json:"value,omitempty"`
	Children map[string]*TreeNode `json:"children,omitempty"`
	Parent   *TreeNode            `json:"-"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL