Documentation ¶
Index ¶
- Constants
- Variables
- func BoolCompletion(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective)
- func EnvName(name string) string
- func InitLog(w io.Writer, level slog.Level, format LogFormat)
- func LogFormatStrings() []string
- func LogLevelStrings() []string
- func WithContext(ctx context.Context, conf *Config) context.Context
- type Config
- type DeprecatedWriter
- type LogFormat
- type Vars
Constants ¶
View Source
const ( Bash = "bash" Zsh = "zsh" Fish = "fish" Powershell = "powershell" )
View Source
const ( VarFlag = "var" InplaceFlag = "inplace" PrefixFlag = "prefix" LeftDelimFlag = "left-delim" RightDelimFlag = "right-delim" IndentFlag = "indent" StripFlag = "strip" NoSourceCommentFlag = "no-source-comment" IgnoreUnsetErrorsFlag = "ignore-unset-errors" IgnoreTemplateErrorsFlag = "ignore-template-errors" LogLevelFlag = "log-level" LogFormatFlag = "log-format" CompletionFlag = "completion" // Deprecated: Replaced by VarFlag ValueFlag = "value" // Deprecated: Removed. Yampl will always recurse if a given path is a directory RecursiveFlag = "recursive" // Deprecated: Replaced by IgnoreUnsetErrorsFlag and IgnoreTemplateErrorsFlag FailFlag = "fail" )
View Source
const CurrentValueKey = "Value"
CurrentValueKey is the key for the current YAML node's value
deprecated
View Source
const EnvPrefix = "YAMPL_"
Variables ¶
View Source
var ErrCmdMissingConfig = errors.New("config missing from command context")
Functions ¶
func BoolCompletion ¶ added in v0.6.0
func LogFormatStrings ¶ added in v0.8.0
func LogFormatStrings() []string
LogFormatStrings returns a slice of all String values of the enum
func LogLevelStrings ¶ added in v0.8.0
func LogLevelStrings() []string
Types ¶
type Config ¶
type Config struct { Vars Vars Inplace bool Prefix string LeftDelim string RightDelim string Indent int Strip bool NoSourceComment bool IgnoreUnsetErrors bool IgnoreTemplateErrors bool LogLevel string LogFormat string Completion string // contains filtered or unexported fields }
func (*Config) RegisterCompletions ¶ added in v0.6.0
func (*Config) RegisterFlags ¶ added in v0.6.0
type DeprecatedWriter ¶ added in v0.6.1
type DeprecatedWriter struct{}
type LogFormat ¶ added in v0.8.0
type LogFormat uint8
func LogFormatString ¶ added in v0.8.0
LogFormatString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func LogFormatValues ¶ added in v0.8.0
func LogFormatValues() []LogFormat
LogFormatValues returns all values of the enum
func (LogFormat) IsALogFormat ¶ added in v0.8.0
IsALogFormat returns "true" if the value is listed in the enum definition. "false" otherwise
func (LogFormat) MarshalText ¶ added in v0.8.0
MarshalText implements the encoding.TextMarshaler interface for LogFormat
func (*LogFormat) UnmarshalText ¶ added in v0.8.0
UnmarshalText implements the encoding.TextUnmarshaler interface for LogFormat
Source Files ¶
Click to show internal directories.
Click to hide internal directories.