models

package
v0.0.0-...-fc80e7b Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 11 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 {
	CreatedAt   sql.NullTime   `json:"createdAt,omitempty" gorm:"autoCreateTime;index"`
	UpdatedAt   sql.NullTime   `json:"updatedAt,omitempty" gorm:"autoUpdateTime;index"`
	DeletedAt   gorm.DeletedAt `json:"deletedAt,omitempty" gorm:"index"`
	Title       string         `json:"title" gorm:"size:127;index"`
	Author      string         `json:"author" gorm:"size:127;index"`
	Description string         `json:"description" gorm:""`
	ID          string         `json:"id" gorm:"size:32;primaryKey"`
}

Book Constructs your Book model under entities.

func (*Book) BeforeCreate

func (b *Book) BeforeCreate(tx *gorm.DB) (err error)

type BooksResponse

type BooksResponse struct {
	Books []Book `json:"books"`
}

type JwtResources

type JwtResources struct {
	JwtVerifyKey     crypto.PublicKey
	JwtSignKey       crypto.PrivateKey
	JwtSigningMethod jwt.SigningMethod
	JwtKeyfunc       jwt.Keyfunc
	JwtParser        *jwt.Parser
}

type Resources

type Resources struct {
	LogConfig      logger.Config
	FastHTTPClient *fasthttp.Client
	MainDbConn     *gorm.DB
	LogDbConn      *mongo.Database
	RedisStorage   *redis.Storage
	JwtResources   *JwtResources
	SessConfig     session.Config
}

type User

type User struct {
	ID        string         `json:"id" gorm:"size:32;primaryKey"`
	Password  string         `json:"password" gorm:"size:64"`
	FullName  string         `json:"full_name" gorm:"size:127;index"`
	Address   string         `json:"address" gorm:"type:text"`
	CreatedAt sql.NullTime   `json:"createdAt,omitempty" gorm:"autoCreateTime;index"`
	UpdatedAt sql.NullTime   `json:"updatedAt,omitempty" gorm:"autoUpdateTime;index"`
	DeletedAt gorm.DeletedAt `json:"deletedAt,omitempty" gorm:"index"`
}

func (*User) BeforeCreate

func (u *User) BeforeCreate(tx *gorm.DB) (err error)

type UserResponse

type UserResponse struct {
	helpers.ResponseForm
}

Jump to

Keyboard shortcuts

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