tool

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeData

func DecodeData(data []byte, i interface{}) error

func DecodeDataByType

func DecodeDataByType(data []byte, t reflect.Type) (interface{}, error)

func EncodeData

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

func EncodeDataByType

func EncodeDataByType(typeValue reflect.Value) ([]byte, error)

func GetOutBoundIP

func GetOutBoundIP() (ip string, err error)

GetOutBoundIP 获取本地出口网卡的本地ip地址

func Lock added in v1.1.0

func Lock(key string)

func RLock added in v1.1.0

func RLock(key string)

func RUnlock added in v1.1.0

func RUnlock(key string)

func RUse added in v1.1.0

func RUse(key string, f func())

func Unlock added in v1.1.0

func Unlock(key string)

func Use added in v1.1.0

func Use(key string, f func())

Types

type MsgpackCodec

type MsgpackCodec struct{}

MsgpackCodec uses messagepack marshaler and unmarshaler.

func (MsgpackCodec) Decode

func (c MsgpackCodec) Decode(data []byte, i interface{}) error

Decode decodes an object from slice of bytes.

func (MsgpackCodec) Encode

func (c MsgpackCodec) Encode(i interface{}) ([]byte, error)

Encode encodes an object into slice of bytes.

Jump to

Keyboard shortcuts

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