utils

package
v2.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormat = "2006-01-02 15:04:05"
	DateFormat = "2006-01-02"
)

Variables

This section is empty.

Functions

func MD5

func MD5(str string) string

MD5 MD5加密

func Now

func Now() string

func String2Int

func String2Int(intStr string) (intNum int)

String2Int 字符串转Int

func Ternary

func Ternary(c bool, s interface{}, p interface{}) interface{}

Ternary 弥补三元运算

Types

type JsonDate

type JsonDate struct {
	time.Time
}

func (JsonDate) MarshalJSON

func (t JsonDate) MarshalJSON() ([]byte, error)

func (*JsonDate) Scan

func (t *JsonDate) Scan(v interface{}) error

func (*JsonDate) UnmarshalJSON

func (t *JsonDate) UnmarshalJSON(data []byte) (err error)

func (JsonDate) Value

func (t JsonDate) Value() (driver.Value, error)

type JsonTime

type JsonTime struct {
	time.Time
}

func (JsonTime) MarshalJSON

func (t JsonTime) MarshalJSON() ([]byte, error)

func (*JsonTime) Scan

func (t *JsonTime) Scan(v interface{}) error

func (*JsonTime) UnmarshalJSON

func (t *JsonTime) UnmarshalJSON(data []byte) (err error)

func (JsonTime) Value

func (t JsonTime) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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