utils

package
v0.0.0-...-151872f Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: Apache-2.0 Imports: 18 Imported by: 9

Documentation

Overview

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Copyright Jetstack Ltd. See LICENSE for details.

Index

Constants

View Source
const (
	DefaultLogsPathPlaceholder  = "./[target group]-logs.tar.gz"
	DefaultLogsSincePlaceholder = `$(date --date='24 hours ago')`
	DefaultLogsUntilPlaceholder = `$(date --date='now')`
)

Variables

This section is empty.

Functions

func BasicSignalHandler

func BasicSignalHandler(l *log.Entry) chan struct{}

func CopyDir

func CopyDir(src string, dst string) (err error)

CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.

func CopyFile

func CopyFile(src, dst string) (err error)

CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.

func DuplicateMapBool

func DuplicateMapBool(base map[string]bool) map[string]bool

func Expand

func Expand(path string) (string, error)

func IndexOfString

func IndexOfString(slice []string, str string) int

func ListParameters

func ListParameters(out io.Writer, keys []string, varMaps []map[string]string)

func MakeShutdownCh

func MakeShutdownCh() <-chan struct{}

func MergeMaps

func MergeMaps(base map[string]interface{}, m ...map[string]interface{}) map[string]interface{}

func MergeMapsBool

func MergeMapsBool(base map[string]bool, m ...map[string]bool) map[string]bool

func NetworkOverlap

func NetworkOverlap(netCIDRs []*net.IPNet) error

func RandStringRunes

func RandStringRunes(n int) string

func RemoveDuplicateInts

func RemoveDuplicateInts(slice []int) (result []int)

func RemoveDuplicateStrings

func RemoveDuplicateStrings(slice []string) (result []string)

func SliceContains

func SliceContains(slice []string, str string) bool

func SliceContainsPrefix

func SliceContainsPrefix(slice []string, prefix string) bool

func UnusedPort

func UnusedPort() int

Types

type CancellationContext

type CancellationContext struct {
	context.Context
	// contains filtered or unexported fields
}

func (*CancellationContext) Err

func (c *CancellationContext) Err() error

func (*CancellationContext) Signal

func (c *CancellationContext) Signal() os.Signal

func (*CancellationContext) TryOrCancel

func (c *CancellationContext) TryOrCancel(done <-chan struct{}) context.Context

func (*CancellationContext) WaitOrCancel

func (c *CancellationContext) WaitOrCancel(f func() error)

func (*CancellationContext) WaitOrCancelReturnCode

func (c *CancellationContext) WaitOrCancelReturnCode(f func() (int, error))

type Closer

type Closer struct {
	// contains filtered or unexported fields
}

func NewCloser

func NewCloser() (*Closer, chan struct{})

func (*Closer) Close

func (c *Closer) Close() error

Directories

Path Synopsis
This implement utilities around git subtree
This implement utilities around git subtree

Jump to

Keyboard shortcuts

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