Documentation
¶
Index ¶
- Constants
- func Debug() bool
- func EndMarker() string
- func Formatter() string
- func FormatterIs(formatter SpFormatter) bool
- func GetEnvWithDefault(env, defaultVal string) string
- func Parse(v interface{}) status.Status
- func ParseJSONItemsArray(v string) (interface{}, error)
- func ParseKeyValueEnv(v string) (interface{}, error)
- func ReadTimeout() time.Duration
- func SetFormatter(format SpFormatter, force bool)
- func ToTypeAwareKeyValue(v map[string]string) map[string]interface{}
- func Validate(s interface{}) error
- type JSONItemsArray
- type OneofValidator
- type SpFormatter
- type Validator
Constants ¶
View Source
const ( ReadTimeoutEnv = "SP_READ_TIMEOUT_SECONDS" EndMarkerEnv = "SP_END_MARKER" DebugEnv = "SP_DEBUG" FormatterEnv = "SP_FORMATTER" )
View Source
const ( ReadTimeoutDefault = 30 * time.Second EndMarkerDefault = "<-- END -->" DebugDefault = false FormatterDefault = "json" )
View Source
const FormatOverrideFile = "/tmp/format.txt"
This file used to override SP_FORMATTER env (in case the step want to override it, because it can't modify the actual env)
Variables ¶
This section is empty.
Functions ¶
func FormatterIs ¶
func FormatterIs(formatter SpFormatter) bool
func GetEnvWithDefault ¶
func ParseJSONItemsArray ¶
func ParseKeyValueEnv ¶
func ReadTimeout ¶
func SetFormatter ¶
func SetFormatter(format SpFormatter, force bool)
func ToTypeAwareKeyValue ¶
Types ¶
type JSONItemsArray ¶
type JSONItemsArray struct {
Items []string
}
This type is useful in case of json input of items array You can find usage example in ssh-parallel command
type OneofValidator ¶
type OneofValidator struct {
// contains filtered or unexported fields
}
func (OneofValidator) Validate ¶
func (v OneofValidator) Validate(val interface{}) (bool, error)
type SpFormatter ¶
type SpFormatter string
const ( JSONFormat SpFormatter = "json" RawFormat SpFormatter = "raw" PrintFormat SpFormatter = "print" )
Click to show internal directories.
Click to hide internal directories.