repository

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const PublicDir = "/api/v1/files/"

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	ID        int64       `db:"id"`
	Name      string      `db:"name"`
	Alt       string      `db:"alt"`
	Caption   string      `db:"caption"`
	Width     int64       `db:"width"`
	Height    int64       `db:"height"`
	Provider  *string     `db:"provider"`
	Hash      string      `db:"hash"`
	Ext       string      `db:"ext"`
	Size      int64       `db:"size"`
	Url       string      `db:"url"`
	Formats   interface{} `db:"formats"`
	Metadata  interface{} `db:"metadata"`
	Mime      string      `db:"mime"`
	Thumb     string      `db:"preview_url"`
	CreatedBy int64       `db:"created_by"`
	UpdatedBy int64       `db:"updated_by"`
	Created   strfmt.Date `db:"created"`
	Updated   strfmt.Date `db:"updated"`
	Deleted   strfmt.Date `db:"deleted"`
}

type FileRepo

type FileRepo struct {
	PublicDir string
	// contains filtered or unexported fields
}

func NewFileRepo

func NewFileRepo(ctx context.Context, store db.Storer) *FileRepo

func (FileRepo) Create

func (f FileRepo) Create(fileMap map[string]interface{}) error

func (FileRepo) GetFileByID

func (f FileRepo) GetFileByID(id int64) (*models.File, error)

func (FileRepo) GetFileByName

func (f FileRepo) GetFileByName(name string) (*models.File, error)

func (FileRepo) GetFiles

func (f FileRepo) GetFiles() ([]*models.File, error)

func (FileRepo) GetPublicFileByID

func (f FileRepo) GetPublicFileByID(id int64) (*models.PublicFile, error)

func (FileRepo) GetPublicFileByName

func (f FileRepo) GetPublicFileByName(name string) (*models.PublicFile, error)

func (FileRepo) GetPublicFilesByProvider

func (f FileRepo) GetPublicFilesByProvider(_provider string) ([]*models.PublicFile, error)

func (FileRepo) Update

func (f FileRepo) Update(fileMap map[string]interface{}) ([]*models.File, error)

type FileRepository

type FileRepository interface {
	Create(fileMap map[string]interface{}) error
	Update(fileMap map[string]interface{}) ([]*models.File, error)
	GetFiles() ([]*models.File, error)
	GetFileByName(name string) (*models.File, error)
	GetFileByID(id int64) (*models.File, error)
	GetPublicFilesByProvider(_provider string) ([]*models.PublicFile, error)
	GetPublicFileByName(name string) (*models.PublicFile, error)
	GetPublicFileByID(id int64) (*models.PublicFile, error)
}

Jump to

Keyboard shortcuts

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