Documentation ¶
Index ¶
- Constants
- func Exec(command string, args []any, inputs ...string) (string, error)
- func Get(path string, varArgs ...any) (any, error)
- func HasKey(path string, varArgs ...any) (bool, error)
- func NewSOPSDecodeError(err error) error
- func ReadFile(file string) (string, error)
- func Required(warn string, val any) (any, error)
- func RequiredEnv(name string) (string, error)
- func ToYaml(v any) (string, error)
- func Tpl2yml(ctx context.Context, tpl, yml string, data any, templaterName string, ...) error
- type SOPSDecodeError
- type Templater
- type TemplaterOptions
- type Values
Constants ¶
const (
TemplaterGomplate = "gomplate"
)
const (
TemplaterNone = "copy"
)
const (
TemplaterSOPS = "sops"
)
const (
TemplaterSprig = "sprig"
)
Variables ¶
This section is empty.
Functions ¶
func Exec ¶
Exec runs external binary and returns its standard output. Used as custom template function.
func Get ¶
Get returns value in map by dot-separated key path. First argument is dot-separated key path. Second argument is default value if key not found and is optional. Third argument is map to search in. Used as custom template function.
func HasKey ¶
HasKey searches for any value by dot-separated key path in map. Used as custom template function.
func NewSOPSDecodeError ¶ added in v0.32.0
func ReadFile ¶
ReadFile reads file and returns its contents as string. Used as custom template function.
func Required ¶
Required returns error if val is nil of empty string. Otherwise it returns the same val. Used as custom template function.
func RequiredEnv ¶
RequiredEnv returns environment variable by name and errors if it is not defined. Used as custom template function.
Types ¶
type SOPSDecodeError ¶ added in v0.32.0
type SOPSDecodeError struct {
Err error
}
func (SOPSDecodeError) Error ¶ added in v0.32.0
func (err SOPSDecodeError) Error() string
func (SOPSDecodeError) Unwrap ¶ added in v0.32.0
func (err SOPSDecodeError) Unwrap() error
type Templater ¶ added in v0.17.0
type Templater interface { Name() string Delims(string, string) Render(context.Context, string, any) ([]byte, error) AddOutput(io.Writer) AddFunc(string, any) }
Templater is interface for using different template function groups.
type TemplaterOptions ¶ added in v0.24.0
type TemplaterOptions func(Templater)
TemplaterOptions is a function that changes templater options.
func AddFunc ¶ added in v0.36.0
func AddFunc(name string, f any) TemplaterOptions
func CopyOutput ¶ added in v0.36.0
func CopyOutput(output io.Writer) TemplaterOptions
func SetDelimiters ¶ added in v0.24.0
func SetDelimiters(left, right string) TemplaterOptions