Documentation ¶
Overview ¶
Index ¶
- func APHash(base uint64, str string) uint64
- func Abs(n time.Duration) time.Duration
- func BKDRHash(base uint64, str string) uint64
- func Bool2Int(b bool) int
- func Bool2UInt32(b bool) uint32
- func Bool2UInt8(b bool) uint8
- func DJBHash(base uint64, str string) uint64
- func FindInterfaceByIp(ip string) *net.Interface
- func GetIpHash(ip net.IP) uint32
- func GetTraceIdIndex(traceId string, indexTypeIsIncremetalId, formatIsHex bool, ...) (uint64, error)
- func IPv4ToBinary(ip uint32) string
- func IPv6ToBinary(ip net.IP) string
- func IpFromUint32(ipInt uint32) net.IP
- func IpNetmaskFromStringCIDR(ipStr string) (net.IP, uint32, error)
- func IpToUint32(ip net.IP) uint32
- func IsMulticast(mac []byte) bool
- func Mac2Uint64(mac net.HardwareAddr) uint64
- func MaskLenToNetmask(mask uint32) uint32
- func Max(x, y int) int
- func Min(x, y int) int
- func Mountpoint(path string) string
- func MurmurHashAdd(hash, data uint32) uint32
- func MurmurHashAddUint64(hash uint32, data uint64) uint32
- func MurmurHashFinish(hash uint32) uint32
- func ParserStringIp(ipStr string) net.IP
- func ParserStringIpV4(ipStr string) net.IP
- func PseudoCloneByteBuffer(bytes *ByteBuffer)
- func ReleaseByteBuffer(bytes *ByteBuffer)
- func SDBMHash(base uint64, str string) uint64
- func Slice(s string) (b []byte)
- func String(b []byte) (s string)
- func Uint64ToMac(v uint64) net.HardwareAddr
- func UintMin(x, y uint) uint
- type ByteBuffer
- type Closable
- type IntBuffer
- func (b *IntBuffer) Reset()
- func (b *IntBuffer) String() string
- func (b *IntBuffer) WriteString(v string)
- func (b *IntBuffer) WriteU16(v uint16)
- func (b *IntBuffer) WriteU24(v uint32)
- func (b *IntBuffer) WriteU32(v uint32)
- func (b *IntBuffer) WriteU48(v uint64)
- func (b *IntBuffer) WriteU64(v uint64)
- func (b *IntBuffer) WriteU8(v byte)
- type RuntimeEnv
- type StructBuffer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool2UInt32 ¶
func Bool2UInt8 ¶
func FindInterfaceByIp ¶
func GetTraceIdIndex ¶
func IPv4ToBinary ¶
func IPv6ToBinary ¶
func IpFromUint32 ¶
func IpToUint32 ¶
func IsMulticast ¶
func Mac2Uint64 ¶
func Mac2Uint64(mac net.HardwareAddr) uint64
func MaskLenToNetmask ¶
func Mountpoint ¶
找出目录对应的mount路径,来自: https://stackoverflow.com/questions/4453602/how-to-find-the-mountpoint-a-file-resides-on
func MurmurHashAdd ¶
func MurmurHashAddUint64 ¶
func MurmurHashFinish ¶
func ParserStringIp ¶
func ParserStringIpV4 ¶
func PseudoCloneByteBuffer ¶
func PseudoCloneByteBuffer(bytes *ByteBuffer)
func ReleaseByteBuffer ¶
func ReleaseByteBuffer(bytes *ByteBuffer)
func Uint64ToMac ¶
func Uint64ToMac(v uint64) net.HardwareAddr
Types ¶
type ByteBuffer ¶
type ByteBuffer struct { pool.ReferenceCount // for PseudoClone // contains filtered or unexported fields }
func AcquireByteBuffer ¶
func AcquireByteBuffer() *ByteBuffer
func CloneByteBuffer ¶
func CloneByteBuffer(bytes *ByteBuffer) *ByteBuffer
func (*ByteBuffer) Reset ¶
func (b *ByteBuffer) Reset()
func (*ByteBuffer) SetQuota ¶
func (b *ByteBuffer) SetQuota(n int)
type IntBuffer ¶
type IntBuffer struct {
// contains filtered or unexported fields
}
func (*IntBuffer) WriteString ¶
type RuntimeEnv ¶
type RuntimeEnv struct { CpuNum uint32 MemorySize uint64 // linux下为uname中Machine字段, 参照 https://en.wikipedia.org/wiki/Uname 和 https://stackoverflow.com/questions/45125516/possible-values-for-uname-m Arch string // 如 x86_64, aarch64, ppc64, armv7l, amd64, i686, i386, mips, sun4u // OS名称+版本号, 参照 github.com/shirou/gopsutil/v3/host/host_linux.go:PlatformInformationWithContext OS string // 如 ubuntu 11.04, centos 7.5.1804, fedora 19, redhat xx, linuxmint xx等 // linux下为uname的Release字段 KernelVersion string // 如 4.19.17 }
运行环境信息
func GetRuntimeEnv ¶
func GetRuntimeEnv() RuntimeEnv
type StructBuffer ¶
type StructBuffer struct { New func() interface{} // contains filtered or unexported fields }
适用于存放可重用的、小规模对象
func (*StructBuffer) Get ¶
func (b *StructBuffer) Get() interface{}
func (*StructBuffer) Reset ¶
func (b *StructBuffer) Reset()
func (*StructBuffer) Slice ¶
func (b *StructBuffer) Slice() []interface{}
Click to show internal directories.
Click to hide internal directories.