file

package
v0.0.0-...-3363d21 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FileSet = wire.NewSet(wire.Struct(new(FileRepo), "*"))

Functions

func GetFileDB

func GetFileDB(ctx context.Context, defDB *gorm.DB) *gorm.DB

Types

type File

type File struct {
	ID        uint64     `gorm:"column:id;primary_key;AUTO_INCREMENT"`
	CreatedAt types.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP"`
	UpdatedAt types.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP"`
	Name      string     `gorm:"column:name"`
	Url       string     `gorm:"column:url"`
	Tag       string     `gorm:"column:tag"`
	Key       string     `gorm:"column:key"`
}

type FileRepo

type FileRepo struct {
	DB *gorm.DB
}

func (*FileRepo) DeleteFile

func (m *FileRepo) DeleteFile(ctx context.Context, id uint64) error

func (*FileRepo) FindFile

func (m *FileRepo) FindFile(ctx context.Context, id uint64) (*File, error)

func (*FileRepo) Upload

func (m *FileRepo) Upload(ctx context.Context, file *File) error

Jump to

Keyboard shortcuts

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