util

package
v1.8.36 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 13 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertMap2String added in v1.6.2

func ConvertMap2String(meta map[string]string) string

func ConvertMeta2Map added in v1.6.2

func ConvertMeta2Map(meta string) map[string]string

func CopyMeta added in v1.3.1

func CopyMeta(src, dst map[string]string)

func ExternalIPV4 added in v1.6.2

func ExternalIPV4() (string, error)

ExternalIPV4 gets external IPv4 address of this server.

func ExternalIPV6 added in v1.6.2

func ExternalIPV6() (string, error)

ExternalIPV6 gets external IPv6 address of this server.

func GetFreePort added in v1.3.1

func GetFreePort() (port int, err error)

GetFreePort gets a free port.

func ParseRpcxAddress added in v1.6.2

func ParseRpcxAddress(addr string) (network string, ip string, port int, err error)

ParseRpcxAddress parses rpcx address such as tcp@127.0.0.1:8972 quic@192.168.1.1:9981

func SliceByteToString

func SliceByteToString(b []byte) string

func StringToSliceByte

func StringToSliceByte(s string) []byte

func Unzip added in v1.3.1

func Unzip(data []byte) ([]byte, error)

Unzip unzips data.

func Zip added in v1.3.1

func Zip(data []byte) ([]byte, error)

Zip zips data.

Types

type LimitedPool added in v1.6.2

type LimitedPool struct {
	// contains filtered or unexported fields
}

func NewLimitedPool added in v1.6.2

func NewLimitedPool(minSize, maxSize int) *LimitedPool

func (*LimitedPool) Get added in v1.6.2

func (p *LimitedPool) Get(size int) *[]byte

func (*LimitedPool) Put added in v1.6.2

func (p *LimitedPool) Put(b *[]byte)

Jump to

Keyboard shortcuts

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