tool

package
v1.1.54 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 24 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode added in v1.1.29

func Base64Decode(s string) (string, error)

Base64Decode 解码 base64 字符串

func Base64DecodeWithoutErr added in v1.1.29

func Base64DecodeWithoutErr(s string) string

Base64DecodeWithoutErr 解码 base64 字符串,忽略错误

func Base64Encode added in v1.1.29

func Base64Encode(s string) string

Base64Encode 编码字符串为 base64

func Base64URLDecode added in v1.1.29

func Base64URLDecode(s string) (string, error)

Base64URLDecode URL 安全的 base64 解码

func Base64URLEncode added in v1.1.29

func Base64URLEncode(s string) string

Base64URLEncode URL 安全的 base64 编码

func BoolPtr added in v0.8.1

func BoolPtr(b bool) *bool

func CallerInfo added in v1.1.43

func CallerInfo(skip int) string

func ClientIP added in v0.7.3

func ClientIP(ctx *gin.Context) string

func ConStringToInt64

func ConStringToInt64(s string) (int64, error)

func ConStringToInt64WithoutErr added in v0.4.4

func ConStringToInt64WithoutErr(s string) int64

func ConvertOpId added in v1.1.46

func ConvertOpId(opId string) string

func Day deprecated added in v0.2.6

func Day() string

Deprecated: 已废弃

func Debug added in v1.1.38

func Debug(keyChains ...string) bool

func ErrCode added in v1.1.28

func ErrCode(err error) int

func FormatToWan added in v0.9.9

func FormatToWan(num int64) string

func GetEnv

func GetEnv() string

func GrpcCtx added in v0.5.4

func GrpcCtx(ctx context.Context) context.Context

func HostId added in v0.7.4

func HostId() string

func Hour deprecated added in v0.2.6

func Hour() string

Deprecated: 已废弃

func Int64Ptr added in v0.8.2

func Int64Ptr(i int64) *int64

func IsDevEnv added in v0.9.5

func IsDevEnv() bool

func IsInterfaceNil added in v1.1.26

func IsInterfaceNil(v interface{}) bool

func IsLetter added in v0.0.2

func IsLetter(s string) bool

func IsProEnv

func IsProEnv() bool

func IsTestEnv added in v0.9.5

func IsTestEnv() bool

func LastMonth deprecated added in v0.3.2

func LastMonth() string

Deprecated: 已废弃

func LastWeek deprecated added in v0.3.1

func LastWeek() string

Deprecated: 已废弃,请使用 timeTool.LastWeek()

func MD5 added in v0.8.3

func MD5(s string) string

func Marshal added in v0.4.0

func Marshal(v interface{}) (string, error)

func MarshalWithoutErr

func MarshalWithoutErr(v interface{}) string

func MergeByJson

func MergeByJson(from interface{}, to interface{})

func MergeByReflection deprecated

func MergeByReflection(from interface{}, to interface{}) error

Deprecated: 已废弃

func MergeConfig

func MergeConfig(config1 *viper.Viper, config2 *viper.Viper) *viper.Viper

func MidnightTody deprecated added in v0.2.9

func MidnightTody() time.Time

Deprecated: 已废弃

func Milliseconds

func Milliseconds() int64

func Minute deprecated added in v0.2.6

func Minute() string

Deprecated: 已废弃

func Month deprecated added in v0.2.6

func Month() string

Deprecated: 已废弃

func NewCtxBK added in v0.6.6

func NewCtxBK() context.Context

func OpId

func OpId(ctx context.Context) string

func OpIdWithoutDefault

func OpIdWithoutDefault(ctx context.Context) string

func RandInt64InRange added in v0.4.3

func RandInt64InRange(min, max int64) int64

RandInt64InRange 生成 [min, max) 的 int64 随机数

func RenewCtx added in v0.6.7

func RenewCtx(ctx context.Context) context.Context

func Second deprecated added in v0.2.6

func Second() string

Deprecated: 已废弃

func UUIDWithoutHyphen

func UUIDWithoutHyphen() string

func Uid added in v0.2.1

func Uid(ctx context.Context) string

func Unmarshal added in v0.4.0

func Unmarshal(data string, v interface{}) error

func UrlContainsCMS added in v0.8.5

func UrlContainsCMS(ctx context.Context) bool

func Week deprecated added in v0.2.2

func Week() string

Deprecated: 已废弃

func WeekDay deprecated added in v0.2.2

func WeekDay() time.Weekday

Deprecated: 已废弃

func Year deprecated added in v0.2.6

func Year() string

Deprecated: 已废弃

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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