template

package
v0.20.81 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const DEBUG_TEMPLATE_SYSTEM = false

Variables

This section is empty.

Functions

func MakeStrOperationFuncMap

func MakeStrOperationFuncMap() map[string]interface{}

Types

type BuildObjectStackFunc

type BuildObjectStackFunc func(stage Stage) map[string]interface{}

type ComponentConfigurationService

type ComponentConfigurationService interface {
	GetComponentConfiguration(query *componentcfg.Query) (payload string, err error)
	GetAndProcessComponentConfiguration(query *componentcfg.Query, varStack map[string]string) (payload string, err error)
}

type ConfigAccessFuncs

type ConfigAccessFuncs map[string]GetConfigFunc

func MakeConfigAccessFuncs

func MakeConfigAccessFuncs(confSvc ComponentConfigurationService, varStack map[string]string) ConfigAccessFuncs

type ConsulTemplateLoader

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

Implements pongo2.TemplateLoader to fetch included templates from Consul paths

func NewConsulTemplateLoader

func NewConsulTemplateLoader(confSvc ComponentConfigurationService, basePath string) *ConsulTemplateLoader

func (*ConsulTemplateLoader) Abs

func (c *ConsulTemplateLoader) Abs(base, name string) string

func (*ConsulTemplateLoader) Get

func (c *ConsulTemplateLoader) Get(path string) (io.Reader, error)

type Field

type Field interface {
	Get() string
	Set(value string)
}

func WrapGeneric

func WrapGeneric(getterF GetterFunc, setterF SetterFunc) Field

func WrapPointer

func WrapPointer(field *string) Field

type Fields

type Fields []Field

func WrapMapItems

func WrapMapItems(items map[string]string) Fields

func WrapSliceItems

func WrapSliceItems(items []string) Fields

func (Fields) Execute

func (fields Fields) Execute(confSvc ComponentConfigurationService, parentPath string, varStack map[string]string, objStack map[string]interface{}, stringTemplateCache map[string]template.Template) (err error)

type GenericWrapper

type GenericWrapper struct {
	Getter GetterFunc
	Setter SetterFunc
}

func (*GenericWrapper) Get

func (t *GenericWrapper) Get() string

func (*GenericWrapper) Set

func (t *GenericWrapper) Set(value string)

type GetConfigFunc

type GetConfigFunc func(string) string

type GetterFunc

type GetterFunc func() string

type PointerWrapper

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

func (*PointerWrapper) Get

func (t *PointerWrapper) Get() string

func (*PointerWrapper) Set

func (t *PointerWrapper) Set(value string)

type Sequence

type Sequence map[Stage]Fields

func (Sequence) Execute

func (sf Sequence) Execute(confSvc ComponentConfigurationService, parentPath string, varStack VarStack, buildObjectStack BuildObjectStackFunc, stringTemplateCache map[string]template.Template) (err error)

type SetterFunc

type SetterFunc func(value string)

type Stage

type Stage int
const (
	// RESOLUTION STAGE ↓      VALUES AVAILABLE ↓
	STAGE0 Stage = iota // parent stack only                         + locals
	STAGE1              // parent stack + defaults                   + locals
	STAGE2              // parent stack + defaults + vars            + locals
	STAGE3              // parent stack + defaults + vars + uservars + locals
	STAGE4              // parent stack + defaults + vars + uservars + locals + full self-object = full stack

)

type ToPtreeFunc

type ToPtreeFunc func(string, string) string

func MakeToPtreeFunc

func MakeToPtreeFunc(varStack map[string]string, propMap map[string]string) ToPtreeFunc

type VarStack

type VarStack struct {
	Locals   map[string]string
	Defaults *gera.StringWrapMap
	Vars     *gera.StringWrapMap
	UserVars *gera.StringWrapMap
}

Jump to

Keyboard shortcuts

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