osutil

package
v0.0.0-...-ba6934c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PermissionDirectory      os.FileMode = 0755
	PermissionExecutableFile os.FileMode = 0755
	PermissionFile           os.FileMode = 0644

	PermissionDirectoryOwnerOnly os.FileMode = 0700
	PermissionFileOwnerOnly      os.FileMode = 0600

	PermissionMaskDirectoryExecute os.FileMode = 0100
)

Variables

This section is empty.

Functions

func GetNewLineSeparator

func GetNewLineSeparator() string

func GetenvOrDefault

func GetenvOrDefault(key string, def string) string

GetenvOrDefault behaves like `os.Getenv`, except it returns a specified default value if the key is not present in the environment.

func Rename

func Rename(ctx context.Context, old, new string) error

Rename is like os.Rename in every way. The context is ignored.

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL