common

package
v0.0.0-...-a62cd00 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func AddJsonDateTypeValidator

func AddJsonDateTypeValidator()

func AddValidatorForServer

func AddValidatorForServer()

func RandomString

func RandomString(length uint) string

func RandomStringWithPrefix

func RandomStringWithPrefix(prefix string, length uint) string

func RandomStringWithSuffix

func RandomStringWithSuffix(suffix string, length uint) string

func ValidateJsonDateType

func ValidateJsonDateType(field reflect.Value) interface{}

Types

type DBJson

type DBJson []map[string]interface{}

func (DBJson) GetInt

func (j DBJson) GetInt(index uint, key string) int

func (DBJson) GetString

func (j DBJson) GetString(index uint, key string) string

func (DBJson) GormDBDataType

func (DBJson) GormDBDataType(db *gorm.DB, field *schema.Field) string

GormDBDataType 指定数据库数据类型

func (DBJson) GormDataType

func (DBJson) GormDataType() string

GormDataType 指定GORM数据类型

func (*DBJson) Scan

func (j *DBJson) Scan(value interface{}) error

func (DBJson) Value

func (j DBJson) Value() (driver.Value, error)

type MultiInt

type MultiInt []int

func (MultiInt) GormDBDataType

func (MultiInt) GormDBDataType(db *gorm.DB, field *schema.Field) string

GormDBDataType 指定数据库数据类型

func (MultiInt) GormDataType

func (MultiInt) GormDataType() string

GormDataType 指定GORM数据类型

func (*MultiInt) Scan

func (s *MultiInt) Scan(src interface{}) error

func (MultiInt) Value

func (s MultiInt) Value() (driver.Value, error)

type MultiString

type MultiString []string

func (MultiString) GormDBDataType

func (MultiString) GormDBDataType(db *gorm.DB, field *schema.Field) string

GormDBDataType 指定数据库数据类型

func (MultiString) GormDataType

func (MultiString) GormDataType() string

GormDataType 指定GORM数据类型

func (*MultiString) Scan

func (s *MultiString) Scan(src interface{}) error

func (MultiString) Value

func (s MultiString) Value() (driver.Value, error)

type MyTime

type MyTime time.Time

func (MyTime) MarshalJSON

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

func (*MyTime) Scan

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

func (MyTime) String

func (t MyTime) String() string

func (*MyTime) UnmarshalJSON

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

func (MyTime) Value

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

Jump to

Keyboard shortcuts

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