util

package
v0.0.0-...-bed3fb8 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BCryptPassword

func BCryptPassword(password string) (string, error)

func ContextWithTimeout

func ContextWithTimeout(timeout int) (context.Context, context.CancelFunc)

func FormatUTCTime

func FormatUTCTime(t time.Time, offset int) time.Time

FormatUTCTime local time -> UTC

func GenSnowflakeString

func GenSnowflakeString() (string, error)

func GetUTCTime

func GetUTCTime() time.Time

GetUTCTime UTC format time now

func IntToString

func IntToString(in int64) string

func Parse32

func Parse32(idStr string) int32

func Parse64

func Parse64(idStr string) int64

func ParseU32

func ParseU32(idStr string) uint32

func ParseU64

func ParseU64(idStr string) uint64

ParseU64 string -> uint64

func ParseUTCTime

func ParseUTCTime(t time.Time, offset int) time.Time

ParseUTCTime UTC -> local time

func Query32

func Query32(c *gin.Context, name string) int32

func Query64

func Query64(c *gin.Context, name string) int64

func QueryU32

func QueryU32(c *gin.Context, name string) uint32

func QueryU64

func QueryU64(c *gin.Context, name string) uint64

QueryU64 extract id from GET parameters

func StringToTime

func StringToTime(str string) (time.Time, error)

StringToTime local time string -> UTC time.Time

func TimeToString

func TimeToString(t time.Time) string

TimeToString UTC time.Time -> local time string

func UintToString

func UintToString(in uint64) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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