utils

package
v2.20.7 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckInDir added in v2.10.0

func CheckInDir(root string, path string) error

func CheckSubInDir added in v2.11.2

func CheckSubInDir(root string, subDir string) error

func CompressGzip added in v2.20.0

func CompressGzip(input []byte, level int) ([]byte, error)

func DeepCopy

func DeepCopy(dst interface{}, src interface{}) error

func Exists

func Exists(path string) bool

func ExpandPath

func ExpandPath(p string) string

func FindStrInSlice

func FindStrInSlice(a []string, s string) int

func GetTmpBaseDir

func GetTmpBaseDir(ctx context.Context) string

func IntMax

func IntMax(a, b int) int

IntMax returns the maximum integer provided

func IntMin

func IntMin(a, b int) int

func IsDirectory

func IsDirectory(path string) bool

func IsFile

func IsFile(path string) bool

func NewGoHelper added in v2.18.4

func NewGoHelper(ctx context.Context, max int) *goHelper

func ParseBoolOrFalse

func ParseBoolOrFalse(s *string) bool

func ParseEnvBool added in v2.13.0

func ParseEnvBool(name string, def bool) (bool, error)

func ParseEnvConfigList added in v2.16.0

func ParseEnvConfigList(prefix string) map[int]string

func ParseEnvConfigSets

func ParseEnvConfigSets(prefix string) map[int]map[string]string

func RandomString

func RandomString(n int) string

func RunParallelE added in v2.20.0

func RunParallelE(ctx context.Context, fs ...func() error) error

func Sha256Bytes

func Sha256Bytes(data []byte) string

func Sha256String

func Sha256String(data string) string

func StrPtr

func StrPtr(s string) *string

func Touch

func Touch(path string) error

func UncompressGzip added in v2.20.0

func UncompressGzip(input []byte) ([]byte, error)

func WithTmpBaseDir added in v2.18.0

func WithTmpBaseDir(ctx context.Context, tmpBaseDir string) context.Context

Types

type Inclusion

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

func NewInclusion

func NewInclusion() *Inclusion

func (*Inclusion) AddExclude

func (inc *Inclusion) AddExclude(typ string, value string)

func (*Inclusion) AddInclude

func (inc *Inclusion) AddInclude(typ string, value string)

func (*Inclusion) CheckIncluded

func (inc *Inclusion) CheckIncluded(l []InclusionEntry, excludeIfNotIncluded bool) bool

func (*Inclusion) GetExcludes added in v2.20.0

func (inc *Inclusion) GetExcludes(typ string) []string

func (*Inclusion) GetIncludes added in v2.20.0

func (inc *Inclusion) GetIncludes(typ string) []string

func (*Inclusion) HasType

func (inc *Inclusion) HasType(typ string) bool

type InclusionEntry

type InclusionEntry struct {
	Type  string
	Value string
}

type OnceByKey

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

func (*OnceByKey) Do

func (o *OnceByKey) Do(key string, cb func())

type OrderedMap

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

func (*OrderedMap) Get

func (s *OrderedMap) Get(v string) (interface{}, bool)

func (*OrderedMap) Has

func (s *OrderedMap) Has(v string) bool

func (*OrderedMap) ListKeys

func (s *OrderedMap) ListKeys() []string

func (*OrderedMap) ListValues

func (s *OrderedMap) ListValues() []interface{}

func (*OrderedMap) Merge added in v2.9.0

func (s *OrderedMap) Merge(other *OrderedMap)

func (*OrderedMap) Set

func (s *OrderedMap) Set(k string, v interface{}) bool

func (*OrderedMap) SetMultiple added in v2.9.0

func (s *OrderedMap) SetMultiple(k []string, v interface{})

type PrettyTable

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

func (*PrettyTable) AddRow

func (t *PrettyTable) AddRow(c ...string)

func (*PrettyTable) Render

func (t *PrettyTable) Render(limitWidths []int) string

func (*PrettyTable) SortRows

func (t *PrettyTable) SortRows(col int)

type Row

type Row []string

type ThreadSafeCache

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

func (*ThreadSafeCache) Get

func (c *ThreadSafeCache) Get(key string, f func() (interface{}, error)) (interface{}, error)

type ThreadSafeMultiCache

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

func (*ThreadSafeMultiCache) Get

func (c *ThreadSafeMultiCache) Get(cacheKey string, key string, f func() (interface{}, error)) (interface{}, error)

Directories

Path Synopsis
conditions
Package conditions provides utilities for manipulating the status conditions of Kubernetes resource objects that implement the Getter and/or Setter interfaces.
Package conditions provides utilities for manipulating the status conditions of Kubernetes resource objects that implement the Getter and/or Setter interfaces.
metrics
Package metrics contains a Recorder and helpers for recoding standard metrics for all GitOps Toolkit components.
Package metrics contains a Recorder and helpers for recoding standard metrics for all GitOps Toolkit components.

Jump to

Keyboard shortcuts

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