dao

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTables

func InitTables(db *egorm.Component) error

Types

type Label

type Label struct {
	Id    int64 `gorm:"primaryKey,autoIncrement"`
	Name  string
	Uid   int64 `gorm:"index"`
	Ctime int64
	Utime int64
}

type LabelDAO

type LabelDAO interface {
	UidLabels(ctx context.Context, uid int64) ([]Label, error)
	CreateLabel(ctx context.Context, label Label) (int64, error)
	GetByID(ctx context.Context, id int64) (Label, error)
}

func NewLabelGORMDAO

func NewLabelGORMDAO(db *egorm.Component) LabelDAO

type LabelGORMDAO

type LabelGORMDAO struct {
	// contains filtered or unexported fields
}

func (*LabelGORMDAO) CreateLabel added in v0.0.3

func (dao *LabelGORMDAO) CreateLabel(ctx context.Context, label Label) (int64, error)

func (*LabelGORMDAO) GetByID added in v0.0.3

func (dao *LabelGORMDAO) GetByID(ctx context.Context, id int64) (Label, error)

func (*LabelGORMDAO) UidLabels

func (dao *LabelGORMDAO) UidLabels(ctx context.Context, uid int64) ([]Label, error)

Jump to

Keyboard shortcuts

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