utils

package
v0.0.0-...-abe9435 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 20 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvDefault

func EnvDefault(nm string, defs ...string) string

func HomePath

func HomePath() string

func Md5String

func Md5String(data string) string

func NewXid

func NewXid() string

NewXid 生成唯一ID

func NewXid64

func NewXid64() string

NewXid64 生成唯一ID-base64

func RandomString

func RandomString(l int) string

RandomString 随机生成字符串

func RepSeparators

func RepSeparators(pth string) string

func Struct2Struct

func Struct2Struct(dst, src interface{}) error

func UnZip

func UnZip(zipPath string, targePath ...string) error

func Zip

func Zip(src string, zipPath string, noDir ...bool) error

Types

type EnvVal

type EnvVal map[string]string

func AllEnv

func AllEnv() EnvVal

func (*EnvVal) SetOs

func (c *EnvVal) SetOs()

type Timer

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

func NewTimer

func NewTimer(tmd time.Duration, now ...bool) *Timer

func (*Timer) Reset

func (c *Timer) Reset(now bool, tmd ...time.Duration)

func (*Timer) Tick

func (c *Timer) Tick() bool

Jump to

Keyboard shortcuts

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