common

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 17 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress added in v0.5.0

func Compress(rawStr string) ([]byte, error)

func CurrentLeftDuration

func CurrentLeftDuration(startTime meta.Time, timeoutSec *int64) time.Duration

func Decompress added in v0.5.0

func Decompress(compressedBytes []byte) (string, error)

func DeepCopyInt64 added in v0.7.0

func DeepCopyInt64(o *int64) *int64

func EqualsPtrInt64 added in v0.7.0

func EqualsPtrInt64(x, y *int64) bool

func FromJson added in v0.2.0

func FromJson(jsonStr string, objAddr interface{})

func FromYaml

func FromYaml(yamlStr string, objAddr interface{})

func GetErrorCause added in v0.8.0

func GetErrorCause(err error) error

func InitAll

func InitAll()

func InitLogger

func InitLogger()

func InitRandSeed

func InitRandSeed()

func IsTimeout

func IsTimeout(leftDuration time.Duration) bool

func MaxInt32 added in v0.7.0

func MaxInt32(x, y int32) int32

func MinInt32 added in v0.7.0

func MinInt32(x, y int32) int32

func NewStopChannel added in v0.4.0

func NewStopChannel() <-chan struct{}

func NilBool

func NilBool() *bool

func NilInt32

func NilInt32() *int32

func PtrBool

func PtrBool(o bool) *bool

func PtrDeletionPropagation added in v0.4.0

func PtrDeletionPropagation(o meta.DeletionPropagation) *meta.DeletionPropagation

func PtrFloat32 added in v0.8.0

func PtrFloat32(o float32) *float32

func PtrFloat64

func PtrFloat64(o float64) *float64

func PtrInt32

func PtrInt32(o int32) *int32

func PtrInt64

func PtrInt64(o int64) *int64

func PtrNow

func PtrNow() *meta.Time

func PtrString

func PtrString(o string) *string

func PtrTime added in v0.4.0

func PtrTime(o meta.Time) *meta.Time

func PtrUID

func PtrUID(o types.UID) *types.UID

func PtrUIDStr

func PtrUIDStr(s string) *types.UID

func Quote

func Quote(s string) string

func RandInt64

func RandInt64(min int64, max int64) int64

Rand in range [min, max]

func ReferEnvVar

func ReferEnvVar(name string) string

func ReferPlaceholder added in v0.4.0

func ReferPlaceholder(name string) string

func SecToDuration

func SecToDuration(sec *int64) time.Duration

func SprintPtrInt32 added in v0.7.0

func SprintPtrInt32(obj *int32) string

func ToJson added in v0.2.0

func ToJson(obj interface{}) string

func ToYaml

func ToYaml(obj interface{}) string

Types

type Empty

type Empty struct{}

type ImmutableSet

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

func NewImmutableSet

func NewImmutableSet(items ...T) ImmutableSet

func (ImmutableSet) Contains

func (s ImmutableSet) Contains(item T) bool

type KlogWriter added in v0.4.0

type KlogWriter struct{}

func (KlogWriter) Write added in v0.4.0

func (w KlogWriter) Write(data []byte) (n int, err error)

type Set

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

func NewSet

func NewSet(items ...T) Set

func (Set) Add

func (s Set) Add(item T) Set

func (Set) Contains

func (s Set) Contains(item T) bool

func (Set) Delete

func (s Set) Delete(item T) Set

type T

type T interface{}

Jump to

Keyboard shortcuts

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