model

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	Id   int64
	Name string
}

User defines an data structure for mysql

type BookModel

type BookModel interface {
	Insert(data *Book) error
	FindOne(id int64) (*Book, error)
	FindOneByFilter(filter map[string]interface{}, opts ...sqlx.Option) (*Book, error)
	FindByFilter(filter map[string]interface{}, opts ...sqlx.Option) ([]*Book, error)
	Save(*Book) *gorm.DB
	Updates(*Book) *gorm.DB
	UpdateByFilter(filter map[string]interface{}, upVal map[string]interface{}) *gorm.DB
	Delete(id int64) error
	DeleteByFilter(filter map[string]interface{}) error
}

BookModel defines a model for user

func NewBookModel

func NewBookModel(conn sqlx.SqlConn) BookModel

NewBookModel creates an instance for UserModel

Jump to

Keyboard shortcuts

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