utils

package
v0.0.0-...-917d9ad Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlignOf

func AlignOf(size, align uint32) uint32

func Assert

func Assert(isAs bool, errMsg string)

Assert Assert boolean and output error message @Method Assert @Param (bool) false assert @Param (string) error message

func AssertEmpty

func AssertEmpty(isNull interface{}, errMsg string)

AssertEmpty Assert Nil and output an error message @Method AssertEmtpy @Param (interface{}) is null assert @Param (string) error message

func AssertError

func AssertError(err error)

AssertError Assert error is null

func GetCurrentGoroutineID

func GetCurrentGoroutineID() int

GetCurrentGoroutineID doc @Method GetCurrentGoroutineID @Summary Return the ID of the current coroutine @Return (int)

func GetStack

func GetStack() string

GetStack Return current stack information @Method GetStack @Return (string)

func JSONSerialize

func JSONSerialize(obj interface{}) string

JSONSerialize doc @Method JSONSerialize @Summary golang object Serialized to json string @Param (interface{}) json object @Return (string) json string

func JSONUnFormSerialize

func JSONUnFormSerialize(data string, v interface{}) error

JSONUnFormSerialize doc @Method JSONUnFormSerialize @Summary Reverse the json string into a golang object @Param (string) json string @Param (interface{}) out json object

func JSONUnSerialize

func JSONUnSerialize(data []byte, v interface{}) error

JSONUnSerialize doc @Method JSONUnSerialize @Summary Reverse the json string [byte] into a golang object @Param ([]byte) json []byte @Param (interface{}) out json object @Return (error)

func Pprof

func Pprof(addr string)

Types

type SharedTicker

type SharedTicker struct {
	sync.Mutex

	Interval time.Duration
	// contains filtered or unexported fields
}

func NewSharedTicker

func NewSharedTicker(interval time.Duration) *SharedTicker

NewSharedTicker constructs a SharedTicker with specified interval.

func (*SharedTicker) Add

func (t *SharedTicker) Add(b TickerTask)

func (*SharedTicker) Closed

func (t *SharedTicker) Closed() bool

func (*SharedTicker) Delete

func (t *SharedTicker) Delete(b TickerTask)

func (*SharedTicker) Tick

func (t *SharedTicker) Tick(interval time.Duration)

type TickerTask

type TickerTask interface {
	Tick()
}

Directories

Path Synopsis
skipmap
SkipMap是一种基于跳表的高性能并发映射.
SkipMap是一种基于跳表的高性能并发映射.
skipset
SkipSet是一种基于跳表的高性能并发集.在典型模式(100000 次操作, 90%包含 9%ADD 1%REMOVE)中, skipset 比内置的sync.Map 快 3 倍 ~ 15 倍.
SkipSet是一种基于跳表的高性能并发集.在典型模式(100000 次操作, 90%包含 9%ADD 1%REMOVE)中, skipset 比内置的sync.Map 快 3 倍 ~ 15 倍.
zset
zset 提供了并发安全排序集,可以用作 Redis zset 的本地替代.
zset 提供了并发安全排序集,可以用作 Redis zset 的本地替代.
internal
runtimex
from golang-go/src/os/endian_big.go
from golang-go/src/os/endian_big.go

Jump to

Keyboard shortcuts

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