db

package
v0.0.0-...-1d573b9 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Database

type Database struct {
	// contains filtered or unexported fields
}

func New

func New() (*Database, error)

func (*Database) Close

func (d *Database) Close() error

func (*Database) GetExpiredFileHashes

func (db *Database) GetExpiredFileHashes() ([]string, error)

func (*Database) GetFile

func (db *Database) GetFile(id string) (File, error)

func (*Database) InitDatabase

func (d *Database) InitDatabase() error

func (*Database) InsertFile

func (db *Database) InsertFile(f File) error

func (*Database) RemoveHashFromFiles

func (db *Database) RemoveHashFromFiles(hash string) error

type File

type File struct {
	ID                string
	CreatedAt         int64
	OriginalURL       string
	OriginalExpiresAt null.Int
	ExpiresAt         null.Int
	Size              int
	Hash              sql.NullString
	ContentType       sql.NullString
	Metadata          string
}

Jump to

Keyboard shortcuts

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