static

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	ID        int64          `json:"id" db:"id,pk,unique,autoinc"`
	Source    string         `json:"source" db:"source"`
	Thumbnail sql.NullString `json:"thumbnail" db:"thumbnail"`
	Alt       sql.NullString `json:"alt" db:"alt"`
}

type Storage

type Storage struct {
	Log *zerolog.Logger
	// contains filtered or unexported fields
}

func NewStorage added in v0.7.0

func NewStorage(db *sqlx.DB, log *zerolog.Logger) *Storage

func (*Storage) AddImage added in v0.7.3

func (s *Storage) AddImage(ctx context.Context, imageType, ext, uploader string, mediaID *uuid.UUID) (dest string, id int64, err error)

func (*Storage) AddVideo

func (s *Storage) AddVideo(v *Video) error

func (*Storage) DeleteImage added in v0.7.3

func (s *Storage) DeleteImage(ctx context.Context, imageID int64) (path string, err error)

DeleteImage looks up the path of the image to delete based on it's id, then deletes the database record and returns the path to be deleted by the controller

func (*Storage) GetImageSource added in v0.7.0

func (s *Storage) GetImageSource(ctx context.Context, id int64) (source string, err error)

func (*Storage) GetOwner added in v0.7.3

func (s *Storage) GetOwner(ctx context.Context, imageID int64) (owner string, err error)

type Video

type Video struct {
	ID        int64          `json:"id" db:"id,pk,unique,autoinc"`
	Source    string         `json:"source" db:"source"`
	Thumbnail sql.NullString `json:"thumbnail" db:"thumbnail"`
	Alt       sql.NullString `json:"alt" db:"alt"`
}

Jump to

Keyboard shortcuts

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