Documentation ¶
Index ¶
- func ConvertToJSONFast(data any) (string, error)
- func ConvertToYAML(data any) (string, error)
- func DecodeYaml(reader io.Reader, out any) error
- func EncodeAsBlock(val interface{}, blockType string) *hclwrite.Block
- func ExecuteShellCommand(ctx context.Context, command string, args []string, options ExecOptions) error
- func FileExists(filename string) bool
- func FromMap(data map[string]any, target any) error
- func GetSystemDir() string
- func IsDir(filename string) bool
- func JoinAbsolutePathWithPath(basePath string, providedPath string) (string, error)
- func MapKeyExists(m map[string]any, key string) bool
- func PrintError(err error)
- func PrintErrorToStdError(err error)
- func PrintErrorToStdErrorAndExit(err error)
- func PrintOrWriteToFile(format string, filePath string, data any, fileMode os.FileMode) error
- func ProcessTemplate(s string, vars map[string]any) (string, error)
- func SetExecOptions(ctx context.Context, component ExecOptions) context.Context
- func StringInSlice(a string, list []string) bool
- func StringKeysFromMap(m map[string]any) []string
- func ToMap(data any) (map[string]any, error)
- func TrimBasePathFromPath(basePath string, path string) string
- func Unique(list []string) []string
- type ExecOptions
- type Formatter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToJSONFast ¶ added in v0.1.2
ConvertToJSONFast converts the provided value to a JSON-encoded string using 'ConfigFastest' config and json.Marshal without indents
func ConvertToYAML ¶ added in v0.1.2
ConvertToYAML converts the provided value to a YAML string
func EncodeAsBlock ¶ added in v0.1.2
func ExecuteShellCommand ¶
func FileExists ¶
FileExists checks if file exists and is not a directory
func GetSystemDir ¶
func GetSystemDir() string
func JoinAbsolutePathWithPath ¶ added in v0.2.1
JoinAbsolutePathWithPath checks if the provided path is absolute. If the provided path is relative, it joins the base path with the path and returns the absolute path
func MapKeyExists ¶ added in v0.1.2
MapKeyExists checks if a key already defined in a map
func PrintErrorToStdError ¶
func PrintErrorToStdError(err error)
PrintErrorToStdError prints errors to std.Error
func PrintErrorToStdErrorAndExit ¶
func PrintErrorToStdErrorAndExit(err error)
PrintErrorToStdErrorAndExit prints errors to std.Error and exits with an error code
func PrintOrWriteToFile ¶
PrintOrWriteToFile converts the provided value to given format and writes it to the specified file
func SetExecOptions ¶ added in v0.2.1
func SetExecOptions(ctx context.Context, component ExecOptions) context.Context
func StringInSlice ¶
func StringKeysFromMap ¶ added in v0.1.2
StringKeysFromMap returns a slice of sorted string keys from the provided map
func TrimBasePathFromPath ¶ added in v0.2.1
TrimBasePathFromPath trims the base path prefix from the path
Types ¶
type ExecOptions ¶
func GetExecOptions ¶ added in v0.2.1
func GetExecOptions(ctx context.Context) ExecOptions