core

package
v0.0.0-...-993f9dd Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: AGPL-3.0 Imports: 9 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 {
	Id uuid.UUID `json:"id" gorm:"primarykey"`
	// Object    string         `json:"object"`
	Metadata  JSONB     `json:"metadata,omitempty" gorm:"default:null"`
	CreatedAt time.Time `json:"created_at,omitempty" gorm:"column:created_at;type:timestamp with time zone;not null"`
	UpdatedAt time.Time `json:"updated_at,omitempty" gorm:"column:updated_at;type:timestamp with time zone;not null"`
}

func (*BaseModel) BeforeCreate

func (m *BaseModel) BeforeCreate(tx *gorm.DB) (err error)

func (*BaseModel) BeforeUpdate

func (m *BaseModel) BeforeUpdate(tx *gorm.DB) (err error)

func (*BaseModel) ParseUUID

func (m *BaseModel) ParseUUID(id string) (err error)

type BigJSON

type BigJSON struct {
	*big.Int
}

func (*BigJSON) Scan

func (b *BigJSON) Scan(src interface{}) error

func (BigJSON) Value

func (b BigJSON) Value() (driver.Value, error)

type FilterModel

type FilterModel struct {
	Id        []uuid.UUID `json:"id,omitempty"`
	CreatedAt *TimeModel  `json:"created_at,omitempty"`
	UpdatedAt *TimeModel  `json:"updated_at,omitempty"`
	DeletedAt *TimeModel  `json:"deleted_at,omitempty"`
}

type JSONB

type JSONB map[string]interface{}

JSONB Interface for JSONB Field of yourTableName Table

func (*JSONB) Add

func (a *JSONB) Add(key string, value interface{}) JSONB

func (*JSONB) Scan

func (a *JSONB) Scan(value interface{}) error

Scan Unmarshal

func (JSONB) Value

func (a JSONB) Value() (driver.Value, error)

Value Marshal

type NumberModel

type NumberModel struct {
	N   int `json:"n,omitempty"`
	Lt  int `json:"lt,omitempty"`
	Gt  int `json:"gt,omitempty"`
	Gte int `json:"gte,omitempty"`
	Lte int `json:"lte,omitempty"`
}

type SoftDeletableModel

type SoftDeletableModel struct {
	Id        uuid.UUID      `json:"id" gorm:"primarykey"`
	Metadata  JSONB          `json:"metadata,omitempty" gorm:"default:null"`
	CreatedAt time.Time      `json:"created_at,omitempty" gorm:"column:created_at;type:timestamp with time zone;not null"`
	UpdatedAt time.Time      `json:"updated_at,omitempty" gorm:"column:updated_at;type:timestamp with time zone;not null"`
	DeletedAt gorm.DeletedAt `json:"deleted_at,omitempty" gorm:"column:deleted_at;index;type:timestamp with time zone"`
}

func (*SoftDeletableModel) BeforeCreate

func (m *SoftDeletableModel) BeforeCreate(tx *gorm.DB) (err error)

func (*SoftDeletableModel) BeforeUpdate

func (m *SoftDeletableModel) BeforeUpdate(tx *gorm.DB) (err error)

func (*SoftDeletableModel) ParseUUID

func (m *SoftDeletableModel) ParseUUID(id string) (err error)

type StringModel

type StringModel struct {
	N   string `json:"n,omitempty"`
	Lt  string `json:"lt,omitempty"`
	Gt  string `json:"gt,omitempty"`
	Gte string `json:"gte,omitempty"`
	Lte string `json:"lte,omitempty"`
}

type TimeModel

type TimeModel struct {
	N   time.Time `json:"n,omitempty"`
	Lt  time.Time `json:"lt,omitempty"`
	Gt  time.Time `json:"gt,omitempty"`
	Gte time.Time `json:"gte,omitempty"`
	Lte time.Time `json:"lte,omitempty"`
}

type UUIDSlice

type UUIDSlice uuid.UUIDs

func (UUIDSlice) GormDataType

func (UUIDSlice) GormDataType() string

func (*UUIDSlice) Scan

func (uuids *UUIDSlice) Scan(value interface{}) error

func (*UUIDSlice) Value

func (uuids *UUIDSlice) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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