util

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EtcdMapperPrefix = "core.mapper."
)
View Source
const RangeOutIndex = -1

Variables

View Source
var ErrMaxStackDepthExceeded = errors.New("maximum stack depth exceeded")

Functions

func DebugInfo added in v0.3.0

func DebugInfo(msg string, v interface{})

func ExtractMap added in v0.3.0

func ExtractMap(m map[string]string) string

func FormatMapper added in v0.3.0

func FormatMapper(typ, id, name string) string

func GetV1ResultBadRequest

func GetV1ResultBadRequest(msg string) *v1.Result

func GetV1ResultInternalError

func GetV1ResultInternalError(msg string) *v1.Result

func GetV1ResultOK

func GetV1ResultOK() *v1.Result

func Hash32 added in v0.4.1

func Hash32(text string) uint32

func ParseSearchEngine added in v0.3.1

func ParseSearchEngine(dsn string) (drive driver.Type, username, password string, urls []string, err error)

func ResolveAddr added in v0.4.1

func ResolveAddr() string
func Search(slice sort.StringSlice, elem string) int

func SliceAppend added in v0.4.1

func SliceAppend(slice sort.StringSlice, vals []string) sort.StringSlice

func UUID added in v0.4.1

func UUID(prefix string) string

uuid generate an uuid.

func Unique added in v0.4.1

func Unique(slice sort.StringSlice) sort.StringSlice

Unique input order slice.

func UnixMilli added in v0.3.1

func UnixMilli() int64

func UnwrapS added in v0.4.1

func UnwrapS(s string) string

func WrapS added in v0.4.1

func WrapS(str string) string

Types

type ElapsedTime added in v0.3.1

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

func NewElapsed added in v0.3.1

func NewElapsed() *ElapsedTime

NewElapsed returns ElapsedTime.

func NewElapsedFrom added in v0.4.1

func NewElapsedFrom(t time.Time) *ElapsedTime

NewElapsedFrom construct ElapsedTime from t.

func (*ElapsedTime) Elapsed added in v0.3.1

func (et *ElapsedTime) Elapsed() time.Duration

Elapsed returns elapsed duration.

func (*ElapsedTime) ElapsedMicro added in v0.3.1

func (et *ElapsedTime) ElapsedMicro() int64

ElapsedMicro returns elapsed microseconds.

func (*ElapsedTime) ElapsedMilli added in v0.3.1

func (et *ElapsedTime) ElapsedMilli() int64

ElapsedMill returns elapsed milliseconds.

func (*ElapsedTime) ElapsedNano added in v0.3.1

func (et *ElapsedTime) ElapsedNano() int64

ElapsedNano returns elapsed nanoseconds.

func (*ElapsedTime) ElapsedSecond added in v0.3.1

func (et *ElapsedTime) ElapsedSecond() int64

ElapsedSecond returns elapsed seconds.

func (*ElapsedTime) Reset added in v0.4.1

func (et *ElapsedTime) Reset() *ElapsedTime

type ReEntryLock added in v0.2.1

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

ReEntryLock re-entry lock.

func NewReEntryLock added in v0.2.1

func NewReEntryLock(maxStackDepth int32) *ReEntryLock

func (*ReEntryLock) Lock added in v0.2.1

func (a *ReEntryLock) Lock(requestID *string) error

func (*ReEntryLock) Unlock added in v0.2.1

func (a *ReEntryLock) Unlock()

type Waiter added in v0.4.1

type Waiter interface {
	Add(int)
	Done()
	Wait()
}

func NewWaiter added in v0.4.1

func NewWaiter() Waiter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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