dao

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	ID        uint64    `gorm:"primary_key"`
	CreatedAt time.Time `gorm:"not null; index:idx_created_at"`
	UpdatedAt time.Time `gorm:"not null"`
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) Base

func (Base) DB

func (m Base) DB(readOnly bool) *gorm.DB

type Option

type Option func(*Base)

func WithContext

func WithContext(ctx context.Context) Option

func WithCreatedTime

func WithCreatedTime(timestamp time.Time) Option

func WithDB

func WithDB(tx *gorm.DB) Option

func WithPrimaryKey

func WithPrimaryKey(id uint64) Option

Jump to

Keyboard shortcuts

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