customType

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TimeSchemaToDatetime = "2006-01-02 15:04:05"
	TimeSchemaToDate     = "2006-01-02"
	TimeSchemaToTime     = "15:04:05"
)

Functions

This section is empty.

Types

type CustomTime

type CustomTime struct {
	time.Time
}

func (*CustomTime) MarshalJSON

func (ct *CustomTime) MarshalJSON() ([]byte, error)

序列化时的回调:json.Marshal

func (*CustomTime) Scan

func (ct *CustomTime) Scan(value interface{}) error

gorm读取数据的回调

func (*CustomTime) UnmarshalJSON

func (ct *CustomTime) UnmarshalJSON(b []byte) error

反序列化时的回调:json.Unmarshal

func (CustomTime) Value

func (ct CustomTime) Value() (driver.Value, error)

gorm写入数据的回调

Jump to

Keyboard shortcuts

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