gutils

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertMap2String

func ConvertMap2String(meta map[string]string) string

func ConvertMeta2Map

func ConvertMeta2Map(meta string) map[string]string

func Decode

func Decode(val map[string]interface{}, fn interface{}) (gErr error)

func EncodePassword

func EncodePassword(unencoded string) string

func ExternalIPV4

func ExternalIPV4() (string, error)

ExternalIPV4 gets external IPv4 address of this server.

func ExternalIPV6

func ExternalIPV6() (string, error)

ExternalIPV6 gets external IPv6 address of this server.

func GetFreePort

func GetFreePort() (port int, err error)

GetFreePort gets a free port.

func Map

func Map(dst, src interface{}, opts ...func(*mergo.Config)) error

func Marshal

func Marshal(v interface{}) string

func MarshalIndent

func MarshalIndent(v interface{}) string

func Mergo

func Mergo(dst, src interface{}, opts ...func(*mergo.Config)) error

func ParseBool

func ParseBool(data string) bool

ParseBool true

func ParseRpcxAddress

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 PathExist

func PathExist(path string) bool

func Retry

func Retry(c int, fn func() error) (err error)

func StructMerge

func StructMerge(dst, src interface{}) error

func UnWrap

func UnWrap(t interface{}, fn interface{}) (err error)

func Unzip

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

Unzip unzips data.

func Zip

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

Zip zips data.

Types

type SnappyCompressor

type SnappyCompressor struct {
}

SnappyCompressor implements snappy compressor

func (*SnappyCompressor) Unzip

func (c *SnappyCompressor) Unzip(data []byte) ([]byte, error)

func (*SnappyCompressor) Zip

func (c *SnappyCompressor) Zip(data []byte) ([]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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