template package - github.com/AliceO2Group/Control/configuration/template - Go Packages
Package template provides template processing functionality for configuration files, including custom field handling and template execution.
- Constants
- func MakeConfigAccessObject(confSvc ConfigurationService, varStack map[string]string) map[string]interface{}
- func MakeConfigAndRepoAccessFuncs(confSvc ConfigurationService, varStack map[string]string, ...) map[string]interface{}
- func MakePluginObjectStack(varStack map[string]string, baseConfigStack map[string]string) map[string]interface{}
- func MakeUtilFuncMap(varStack map[string]string) map[string]interface{}
- func NullCallback(_ Stage, err error) error
- type BuildObjectStackFunc
- type ConfigAccessFuncs
- type ConfigurationService
- type ConsulTemplateLoader
- type Field
- type Fields
- type GenericWrapper
- type GetConfigFunc
- type GetMultiVarConfigFunc
- type GetterFunc
- type MultiVarConfigAccessFuncs
- type PointerWrapper
- type RoleDisabledError
- type Sequence
- type SetterFunc
- type Stage
- type StageCallbackFunc
- type ToPtreeFunc
- type VarStack
This section is empty.
type ConfigurationService interface {
GetComponentConfiguration(query *componentcfg.Query) (payload string, err error)
GetComponentConfigurationWithLastIndex(query *componentcfg.Query) (payload string, lastIndex uint64, err error)
GetAndProcessComponentConfiguration(query *componentcfg.Query, varStack map[string]string) (payload string, err error)
ResolveComponentQuery(query *componentcfg.Query) (resolved *componentcfg.Query, err error)
GetDetectorForHost(hostname string) (string, error)
GetDetectorsForHosts(hosts []string) ([]string, error)
GetCRUCardsForHost(hostname string) ([]string, error)
GetEndpointsForCRUCard(hostname, cardSerial string) ([]string, error)
GetRuntimeEntry(component string, key string) (string, error)
SetRuntimeEntry(component string, key string, value string) error
}
type ConsulTemplateLoader struct {
}
Implements pongo2.TemplateLoader to fetch included templates from Consul paths
func NewConsulTemplateLoader(confSvc ConfigurationService, basePath string) *ConsulTemplateLoader
func WrapGeneric(getterF GetterFunc, setterF SetterFunc) Field
WrapMapItems creates a slice of Fields from a map of string key-value pairs. It wraps each map item in a GenericWrapper, allowing for dynamic access and modification of the original map's values through the Fields interface.
Parameters:
- items: A map[string]string to be wrapped
Returns:
- Fields: A slice of Field interfaces, each corresponding to a map item
WrapSliceItems creates a slice of Fields from a slice of strings. It wraps each string item in a GenericWrapper, allowing for dynamic access and modification of the original slice's elements through the Fields interface.
Parameters:
- items: A []string to be wrapped
Returns:
- Fields: A slice of Field interfaces, each corresponding to a slice item
type GenericWrapper struct {
Getter GetterFunc
Setter SetterFunc
}
type MultiVarConfigAccessFuncs map[string]GetMultiVarConfigFunc
type PointerWrapper struct {
}
type RoleDisabledError struct {
RolePath string
}
type SetterFunc func(value string)