Documentation
¶
Index ¶
- func ExtractTemplateVariables(input string) []string
- func GetResolvedAliases(ctx *Context) map[string]string
- func HasUnresolvedVariables(input string) bool
- func IsSecretPath(path string) bool
- func Substitute(input string, ctx *Context) string
- func ValidateTemplate(input string) ([]string, error)
- func ValidateTemplateVariables(input string, ctx *Context) ([]string, error)
- type Category
- type Context
- type Host
- type Info
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractTemplateVariables ¶
ExtractTemplateVariables finds all {{ ... }} template variables and returns their paths. Whitespace around the variable name is trimmed and duplicates are removed preserving order.
func GetResolvedAliases ¶
GetResolvedAliases returns all aliases with their resolved values
func HasUnresolvedVariables ¶
HasUnresolvedVariables returns true if input contains any unresolved template variables.
func IsSecretPath ¶
IsSecretPath reports whether an alias path names credential material that must be redacted from API responses.
func Substitute ¶
Substitute replaces all alias placeholders in a string with reflected/resolved values
func ValidateTemplate ¶
ValidateTemplate checks template string syntax, balanced delimiters, and variable prefixes.
Types ¶
type Context ¶
type Context struct {
Server *models.Server
ServerConfig *models.ServerConfig
Module *models.Module
Modules map[string]*models.Module // Sibling modules by name (for inter-module references)
Host *Host
Config *config.Config
}
Context holds the objects available for alias resolution
func NewContext ¶
func NewContext() *Context
NewContext creates a context with host information populated
type Info ¶
type Info struct {
Alias string // e.g., "{{server.id}}"
Path string // e.g., "server.id"
Description string // From struct tag or generated
Category Category
ExampleValue string // Resolved value when context available
FieldType string // Go type name
}
Info contains metadata about an available alias
func GetAvailableAliases ¶
GetAvailableAliases returns all available aliases with their metadata