models

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 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 Base

type Base struct {
	UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp with time zone" json:"-" sig:"-"`
	CreatedAt time.Time `gorm:"column:created_at;type:timestamp with time zone" json:"-" sig:"-"`
}

Base is the base model for all data model.

func (Base) TimestampFieldName

func (b Base) TimestampFieldName() string

TimestampFieldName return created at as our timestamp.

type CustomIndex

type CustomIndex struct {
	Name      string
	Unique    bool
	Fields    []string
	Type      string
	Condition string
}

CustomIndex defines index information

type CustomIndexer

type CustomIndexer interface {
	Indexes() []CustomIndex
}

CustomIndexer defines a interface for models that decouples creating index from Gorm tag functionality

type ForeignKeyConstrainer

type ForeignKeyConstrainer interface {
	ForeignKeyConstraints() []ForeignKeyConstraint
}

ForeignKeyConstrainer defines a interface for models that support creating foreign key constraints.

type ForeignKeyConstraint

type ForeignKeyConstraint struct {
	Field    string
	Dest     string
	OnDelete string
	OnUpdate string
}

ForeignKeyConstraint defines the required arguments to the AddForeignKey call.

type SignedModelBase

type SignedModelBase struct {
	Signature string `gorm:"column:sig;type:varchar(64)" json:"-" sig:"-" bigquery:"-"`
}

SignedModelBase adds a signature column to a model.

func (*SignedModelBase) GetSignature

func (s *SignedModelBase) GetSignature() string

GetSignature implements the SignaturedRecord interface.

func (*SignedModelBase) SetSignature

func (s *SignedModelBase) SetSignature(sig string)

SetSignature implements the SignaturedRecord interface.

type System

type System struct {
	Base

	ID    int64        `gorm:"column:id;primary_key;AUTO_INCREMENT;not null" json:"id"`
	Name  types.SysVar `gorm:"column:name;primary_key;type:varchar(50);not null" json:"-" bigquery:"primary_key"`
	Value string       `gorm:"column:value;primary_key;type:varchar(512)" json:"-"`
}

System defines the table to store system variables.

func (System) Purged

func (s System) Purged() interface{}

Purged implements bigquery.Exportable interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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