models

package
v0.0.14 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	Desc     string         `json:"-" gorm:"-"`
	Instance any            `json:"-" gorm:"-"`
	Context  map[string]any `json:"-" gorm:"-"`
}

func (*BaseModel) Create

func (bm *BaseModel) Create(db *gorm.DB) error

func (*BaseModel) Delete

func (bm *BaseModel) Delete(db *gorm.DB) error

func (*BaseModel) Description

func (bm *BaseModel) Description() string

func (*BaseModel) GetPk

func (bm *BaseModel) GetPk() uint

func (*BaseModel) SetPK

func (bm *BaseModel) SetPK(pk interface{}) error

func (*BaseModel) TableName

func (bm *BaseModel) TableName() string

func (*BaseModel) Update

func (bm *BaseModel) Update(db *gorm.DB) error

type BaseModelInterface

type BaseModelInterface interface {
	Create(*gorm.DB) error
	Update(*gorm.DB) error
	Delete(*gorm.DB) error
	Description() string
	TableName() string
	GetPk() interface{}
	SetPK(pk interface{}) error
	PrimaryKey(v interface{}) map[string]interface{}
}

type QuerySet

type QuerySet interface {
	Get(model BaseModelInterface) error
	Filter(model BaseModelInterface) error
}

Jump to

Keyboard shortcuts

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