util

package
v0.0.0-...-98ba599 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertProtoEqual

func AssertProtoEqual(t *testing.T, expected, actual proto.Message)

func CmpProtoTimestamps

func CmpProtoTimestamps(l, r *timestamp.Timestamp) bool

func ConvertStructsToMap

func ConvertStructsToMap(i interface{}) (map[string]interface{}, error)

func LogIfError

func LogIfError(err error)

func MustConvertStructsToMap

func MustConvertStructsToMap(i interface{}) map[string]interface{}

func MustTimestamp

func MustTimestamp(protoTs *timestamp.Timestamp) time.Time

func MustTimestampProto

func MustTimestampProto(ts time.Time) *timestamp.Timestamp

func Truncate

func Truncate(val interface{}, maxLen int) string

func UID

func UID() string

UID generates a unique id

func Wait

func Wait(wg *sync.WaitGroup, timeout time.Duration) bool

Wait is a sync.WaitGroup.Wait() implementation that supports timeouts

Types

type Number

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

Numeric is a representation

func ToNumber

func ToNumber(val interface{}) (Number, error)

func (Number) Value

func (n Number) Value() interface{}

type SyncMapLen

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

SyncMapLen is simply a sync.Map with options to retrieve the length of it.

func (*SyncMapLen) Delete

func (e *SyncMapLen) Delete(id string)

func (*SyncMapLen) Len

func (e *SyncMapLen) Len() int

func (*SyncMapLen) Load

func (e *SyncMapLen) Load(key interface{}) (value interface{}, ok bool)

func (*SyncMapLen) LoadOrStore

func (e *SyncMapLen) LoadOrStore(key interface{}, value interface{}) (actual interface{}, loaded bool)

func (*SyncMapLen) Range

func (e *SyncMapLen) Range(f func(key interface{}, value interface{}) bool)

func (*SyncMapLen) Store

func (e *SyncMapLen) Store(key, value interface{})

Directories

Path Synopsis
package gopool provides functionality for bounded parallelism with goroutines
package gopool provides functionality for bounded parallelism with goroutines
Package labels provides storing, fetching and matching based on labels.
Package labels provides storing, fetching and matching based on labels.
Package mediatype implements the IANA Media Type standard.
Package mediatype implements the IANA Media Type standard.
Package pubsub is a simple, label-based, thread-safe PubSub implementation.
Package pubsub is a simple, label-based, thread-safe PubSub implementation.
package workqueue is a amended copy of k8s' workqueue implementation Changes made: - workqueue.go - Added MaxSize field to default workqueue.
package workqueue is a amended copy of k8s' workqueue implementation Changes made: - workqueue.go - Added MaxSize field to default workqueue.

Jump to

Keyboard shortcuts

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