kgorm

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDB

func NewDB(dsn string) *gorm.DB

func NewGormLogger

func NewGormLogger(slows ...time.Duration) logger.Interface

func NewMemDB

func NewMemDB() *gorm.DB

func NewMysqlDB

func NewMysqlDB(dsn string) *gorm.DB

Types

type IDModel

type IDModel struct {
	ID        uint64         `gorm:"primarykey" json:"id"`
	DeletedAt gorm.DeletedAt `gorm:"index"      json:"-"`
	CreatedAt Msec           `json:"ca"`
	UpdatedAt Msec           `json:"ua"`
}

func (*IDModel) BeforeCreate

func (p *IDModel) BeforeCreate(_ *gorm.DB) error

type Msec

type Msec time.Time

func (Msec) MarshalJSON

func (p Msec) MarshalJSON() ([]byte, error)

func (Msec) Milli added in v1.0.2

func (p Msec) Milli() int64

func (*Msec) UnmarshalJSON

func (p *Msec) UnmarshalJSON(b []byte) error

func (Msec) Value

func (p Msec) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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