common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2018 License: MIT Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentLeftDuration

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

func FromYaml

func FromYaml(yamlStr string, objAddr interface{})

func InitAll

func InitAll()

func InitLogger

func InitLogger()

func InitRandSeed

func InitRandSeed()

func IsTimeout

func IsTimeout(leftDuration time.Duration) bool

func LogLines

func LogLines(format string, args ...interface{})

func NilBool

func NilBool() *bool

func NilInt32

func NilInt32() *int32

func PtrBool

func PtrBool(o bool) *bool

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 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 SecToDuration

func SecToDuration(sec *int64) time.Duration

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 LogHook

type LogHook struct {
	LogLevels []log.Level
	LogWriter io.Writer
}

func (*LogHook) Fire

func (lh *LogHook) Fire(entry *log.Entry) error

func (*LogHook) Levels

func (lh *LogHook) Levels() []log.Level

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