Documentation
¶
Index ¶
- type EnvironmentRegistry
- func (er *EnvironmentRegistry) Env(key string) string
- func (er *EnvironmentRegistry) ExpandEnv(value string) string
- func (or *EnvironmentRegistry) LinkHandler(fh sprout.Handler) error
- func (er *EnvironmentRegistry) RegisterFunctions(funcsMap sprout.FunctionMap) error
- func (or *EnvironmentRegistry) UID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnvironmentRegistry ¶
type EnvironmentRegistry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *EnvironmentRegistry
NewRegistry creates a new instance of env registry.
func (*EnvironmentRegistry) Env ¶
func (er *EnvironmentRegistry) Env(key string) string
Env retrieves the value of an environment variable.
Parameters:
key string - the name of the environment variable.
Returns:
string - the value of the environment variable.
For an example of this function in a Go template, refer to Sprout Documentation: env.
func (*EnvironmentRegistry) ExpandEnv ¶
func (er *EnvironmentRegistry) ExpandEnv(value string) string
ExpandEnv replaces ${var} or $var in the string based on the values of the current environment variables.
Parameters:
value string - the string with environment variables to expand.
Returns:
string - the expanded string.
For an example of this function in a Go template, refer to Sprout Documentation: expandEnv.
func (*EnvironmentRegistry) LinkHandler ¶
func (or *EnvironmentRegistry) LinkHandler(fh sprout.Handler) error
LinkHandler links the handler to the registry at runtime.
func (*EnvironmentRegistry) RegisterFunctions ¶
func (er *EnvironmentRegistry) RegisterFunctions(funcsMap sprout.FunctionMap) error
RegisterFunctions registers all functions of the registry.
func (*EnvironmentRegistry) UID ¶ added in v1.0.0
func (or *EnvironmentRegistry) UID() string
UID returns the unique identifier of the registry.
Click to show internal directories.
Click to hide internal directories.