entity

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Folder

type Folder struct {
	Id        uuid.UUID  `json:"id" gorm:"type:uuid;primary_key"`
	Name      string     `json:"name"`
	CreatedAt time.Time  `json:"-"`
	UpdatedAt time.Time  `json:"-"`
	FolderId  *uuid.UUID `json:"parentFolderId"`
	Folder    *Folder    `json:"-" gorm:"constraint:OnDelete:CASCADE"`
	Medias    []Media    `gorm:"constraint:OnDelete:CASCADE" json:"-"`
}

func (Folder) TableName

func (Folder) TableName() string

type Media

type Media struct {
	Id        uuid.UUID  `gorm:"type:uuid;primary_key" json:"id"`
	Name      string     `json:"name"`
	Filename  string     `json:"filename"`
	Alt       string     `json:"alt"`
	Title     string     `json:"title"`
	Size      int64      `json:"size"`
	Filepath  string     `json:"filepath" gorm:"unique_index"`
	CreatedAt time.Time  `json:"createdAt"`
	UpdatedAt time.Time  `json:"updatedAt"`
	FolderId  *uuid.UUID `json:"folderId" gorm:"type:uuid"`
}

func (Media) TableName

func (Media) TableName() string

type MediaList

type MediaList struct {
	Total int     `json:"total"`
	Items []Media `json:"items"`
}

Jump to

Keyboard shortcuts

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