models

package
v0.0.0-...-e09cdd1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicModel

type BasicModel struct {
	ID        string         `gorm:"primarykey" json:"id"`
	CreatedAt time.Time      `gorm:"index" json:"created_at"`
	UpdatedAt time.Time      `gorm:"index" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

type JSONMap

type JSONMap map[string]interface{}

JSONMap defiend JSON data type, need to implements driver.Valuer, sql.Scanner interface

func (JSONMap) GormDBDataType

func (JSONMap) GormDBDataType(db *gorm.DB, field *schema.Field) string

GormDBDataType gorm db data type

func (JSONMap) GormDataType

func (m JSONMap) GormDataType() string

GormDataType gorm common data type

func (JSONMap) MarshalJSON

func (m JSONMap) MarshalJSON() ([]byte, error)

MarshalJSON to output non base64 encoded []byte

func (*JSONMap) Scan

func (m *JSONMap) Scan(val interface{}) error

Scan scan value into Jsonb, implements sql.Scanner interface

func (*JSONMap) UnmarshalJSON

func (m *JSONMap) UnmarshalJSON(b []byte) error

UnmarshalJSON to deserialize []byte

func (JSONMap) Value

func (m JSONMap) Value() (driver.Value, error)

Value return json value, implement driver.Valuer interface

type KVStorage

type KVStorage struct {
	BasicModel
	ProjectId string  `gorm:"type:varchar(300);index" json:"project_id"`
	Account   string  `gorm:"type:varchar(300);index" json:"account"`
	Bucket    string  `gorm:"type:varchar(300);index" json:"bucket"`
	Key       string  `gorm:"type:varchar(600);index" json:"key"`
	Search    string  `gorm:"type:varchar(600);index" json:"search"` // 前後 like 不走索引
	Payload   JSONMap `json:"payload"`
}

type ManagerProject

type ManagerProject struct {
	BasicModel
	UserID      string `gorm:"type:varchar(300);index"`
	ProjectName string `gorm:"type:varchar(300);"`
	Payload     ProjectPayload
}

type ManagerUser

type ManagerUser struct {
	BasicModel
	Email    string `gorm:"type:varchar(300);uniqueIndex"`
	Password string `gorm:"type:varchar(600)"`
}

type ProjectPayload

type ProjectPayload struct {
	Buckets []string `json:"buckets"`
}

func (ProjectPayload) GormDBDataType

func (ProjectPayload) GormDBDataType(db *gorm.DB, field *schema.Field) string

GormDBDataType gorm db data type

func (*ProjectPayload) Scan

func (c *ProjectPayload) Scan(value interface{}) error

func (ProjectPayload) Value

func (c ProjectPayload) Value() (driver.Value, error)

type UserCenter

type UserCenter struct {
	BasicModel
	ProjectId string `gorm:"type:varchar(300);index"`
	Account   string `gorm:"type:varchar(300);index"`
	Password  string `gorm:"type:varchar(600)"`
	Payload   JSONMap
}

Jump to

Keyboard shortcuts

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