Documentation
¶
Index ¶
- Constants
- func DirExists(dirPath string) bool
- func FileExists(filePath string) bool
- func GetNewLineSeparator() string
- func GetenvOrDefault(key string, def string) string
- func IsDirEmpty(directoryPath string, treatMissingAsEmpty ...bool) (bool, error)
- func Rename(ctx context.Context, old, new string) error
- func RunningFromPipeline() bool
- type ExpandableString
- func (e ExpandableString) Empty() bool
- func (e ExpandableString) Envsubst(mapping func(string) string) (string, error)
- func (e ExpandableString) MarshalYAML() (interface{}, error)
- func (e ExpandableString) MustEnvsubst(mapping func(string) string) string
- func (e *ExpandableString) UnmarshalYAML(unmarshal func(interface{}) error) error
- type RetryStrategy
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func DirExists ¶
DirExists checks if the given directory path exists. It returns true if the directory exists, false otherwise.
func FileExists ¶
FileExists checks if the given file path exists and is a regular file. It returns true if the file exists and is regular, false otherwise.
func GetNewLineSeparator ¶
func GetNewLineSeparator() string
func GetenvOrDefault ¶
GetenvOrDefault behaves like `os.Getenv`, except it returns a specified default value if the key is not present in the environment.
func IsDirEmpty ¶
IsDirEmpty checks if the given directory is empty. If the directory does not exist, it can either treat it as an error or as an empty directory based on the input flag. By default, it treats a missing directory as an error.
func RunningFromPipeline ¶
func RunningFromPipeline() bool
Types ¶
type ExpandableString ¶
type ExpandableString struct {
// contains filtered or unexported fields
}
ExpandableString is a string that has ${foo} style references inside which can be evaluated.
func NewExpandableString ¶
func NewExpandableString(template string) ExpandableString
func (ExpandableString) Empty ¶
func (e ExpandableString) Empty() bool
Empty returns true if the template is empty.
func (ExpandableString) Envsubst ¶
func (e ExpandableString) Envsubst(mapping func(string) string) (string, error)
Envsubst evaluates the template, substituting values as envsubst.Eval would.
func (ExpandableString) MarshalYAML ¶
func (e ExpandableString) MarshalYAML() (interface{}, error)
func (ExpandableString) MustEnvsubst ¶
func (e ExpandableString) MustEnvsubst(mapping func(string) string) string
MustEnvsubst evaluates the template, substituting values as envsubst.Eval would and panics if there is an error (for example, the string is malformed).
func (*ExpandableString) UnmarshalYAML ¶
func (e *ExpandableString) UnmarshalYAML(unmarshal func(interface{}) error) error
type RetryStrategy ¶
type RetryStrategy struct { // The maximum number of retries before failing MaxRetries uint64 // The time between each retry attempt RetryBackoff time.Duration }
func NewRetryStrategy ¶
func NewRetryStrategy(maxRetries uint64, retryBackoff time.Duration) *RetryStrategy
Creates a new retry strategy that also reduces the time for when running in test