util

package
v0.0.0-...-6260e1a Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(bytes []byte) string

BytesToString without coping

func GetFirstIP

func GetFirstIP() (string, error)

GetFirstIP gets the first IP of the current host

func GetFirstPrivateIP

func GetFirstPrivateIP() (string, error)

GetFirstPrivateIP gets the first private IP of the current host

func GetPrivateIPList

func GetPrivateIPList() ([]string, error)

GetPrivateIPList gets all the private IPs of the current host

func IPtoUInt

func IPtoUInt(ip string) uint32

IPtoUInt converts an IP to an uint64 integer

func IsPrivateIP

func IsPrivateIP(ip string) bool

IsPrivateIP checks if an IP is a private one, according to some reserved inner IP rules, may be not suitable for all

func JavaStringHash

func JavaStringHash(s string) uint32

JavaStringHash and Java String.hashCode() equivalent

func SnowFlakeID

func SnowFlakeID() string

SnowFlakeID generates a snowflake ID

func StringToBytes

func StringToBytes(str string) []byte

StringToBytes without coping

func UInt64UUID

func UInt64UUID() (uint64, error)

UInt64UUID generates an uint64 UUID

Types

This section is empty.

Jump to

Keyboard shortcuts

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