utils

package
v0.0.0-...-53e3d08 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func A2S

func A2S(a []string) string

A2S generates string from array

func Append

func Append(a []string, m map[string]string) []string

Append appends map

func GenRandomStr

func GenRandomStr(length int) string

GenRandomStr generate specified length random string

func GetKeys

func GetKeys(m map[string]struct{}) []string

GetKeys gets all keys of map

func IsClientID

func IsClientID(v string) bool

IsClientID checks clientID

func KV2S

func KV2S(k string, v interface{}) string

KV2S generates string from key-value

func M2A

func M2A(m map[string]interface{}) []string

M2A generates array from map

func M2S

func M2S(m map[string]interface{}) string

M2S generates string from map

func PutU16

func PutU16(dst []byte, v uint16)

PutU16 puts uint16 into bytes

func PutU64

func PutU64(dst []byte, v uint64)

PutU64 puts uint64 into bytes

func U16

func U16(v []byte) uint16

U16 gets uint16 from bytes

func U64

func U64(v []byte) uint64

U64 gets uint64 from bytes

func U64ToB

func U64ToB(v uint64) []byte

U64ToB converts uint64 to bytes

func U64U64

func U64U64(v []byte) (uint64, uint64)

U64U64 gets two uint64 from bytes

func U64U64ToB

func U64U64ToB(sid, ts uint64) []byte

U64U64ToB converts two uint64 to bytes

Types

type Tomb

type Tomb struct {
	tb.Tomb
	// contains filtered or unexported fields
}

Tomb wraps tomb.Tomb

func (*Tomb) Gos

func (t *Tomb) Gos(fs ...func() error) (err error)

Gos goes functions

func (*Tomb) Kill

func (t *Tomb) Kill()

Kill signal

func (*Tomb) KillWith

func (t *Tomb) KillWith(err error)

KillWith signal with error

func (*Tomb) Wait

func (t *Tomb) Wait() (err error)

Wait waits goroutines terminated

Jump to

Keyboard shortcuts

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