database

package
v0.0.0-...-03dfacc Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func Initialize

func Initialize()

Types

type Blob

type Blob struct {
	ID                string `gorm:"size:36"`
	FilePath          string
	PreviewFilePath   string
	ThumbnailFilePath string
	Width             int
	Height            int
	Hash1             []byte
	Hash2             []byte
	Hash3             []byte
	Hash4             []byte
	CreatedAt         time.Time
	UpdatedAt         time.Time
}

type Post

type Post struct {
	ID        string `gorm:"size:36"`
	UserID    string
	User      User
	BlobID    string
	Blob      Blob `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	SourceURL string
	Tags      []Tag `gorm:"many2many:post_tags;constraint:OnDelete:CASCADE"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Tag

type Tag struct {
	ID        string `gorm:"size:36"`
	Name      string
	CreatedAt time.Time
	UpdatedAt time.Time
	TagTypeID uint
	TagType   TagType
	Note      string `gorm:"type:text"`
	Posts     []Post `gorm:"many2many:post_tags"`
}

type TagType

type TagType struct {
	ID   uint
	Name string
}

type User

type User struct {
	ID        string `gorm:"size:36"`
	Email     string
	Username  string
	Password  string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type UserToken

type UserToken struct {
	ID        uint
	UserID    string
	User      User
	Token     string
	CreatedAt time.Time
	UpdatedAt time.Time
}

Jump to

Keyboard shortcuts

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