database

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddImage

func AddImage(img *Image) error

func Clean

func Clean() error

Cleans up expired database data by deleting rows and their corresponding files.

It retrieves the expiration time from the environment variable "CACHE_TIME" or defaults to "30 days".

Returns an error if there was a problem querying the database or deleting the files.

func Init

func Init()

Types

type Image added in v0.1.0

type Image struct {
	Url      string
	File     string
	Date     string
	CacheKey string
}

func GetImage

func GetImage(url string) (*Image, error)

Jump to

Keyboard shortcuts

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