utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogPath       = "./logs/"
	LogFileName   = "log.log"
	LogMaxSize    = 5
	LogMaxBackups = 5
	LogMaxAge     = 30
	LogCompress   = false
)

Variables

This section is empty.

Functions

func GenerateMd5WithSalt

func GenerateMd5WithSalt(password, salt string) string

func GenerateNumericString

func GenerateNumericString(bits int64) string

GenerateNumericString generate a string only contains numeric characters

func GetMetaWithError

func GetMetaWithError(err error) *api.Metadata

func GetMetaWithErrorString

func GetMetaWithErrorString(err string) *api.Metadata

func GetPasswordSalt

func GetPasswordSalt() (string, error)

GetPasswordSalt returns a random salt string with the given length

func GetSnowflakeId

func GetSnowflakeId() int64

func GetSuccessMeta

func GetSuccessMeta() *api.Metadata

func InitDefaultSnowflakeNode

func InitDefaultSnowflakeNode(node int64)

func IsValidWithRegex

func IsValidWithRegex(pattern, str string) bool

func SetJsonLogger

func SetJsonLogger() log.Logger

func Validate

func Validate(value proto.Message) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳