env

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 2 Imported by: 1

Documentation

Index

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.

Jump to

Keyboard shortcuts

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