database

package
v0.0.0-...-a4359f9 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("Image does not exist")
)

Errors

Functions

This section is empty.

Types

type Image

type Image struct {
	ID     string `json:"id"`
	Author string `json:"author"`
	Width  int    `json:"width"`
	Height int    `json:"height"`
	URL    string `json:"url"`
}

Image contains metadata about an image

type Provider

type Provider interface {
	Get(ctx context.Context, id string) (i *Image, err error)
	GetRandom(ctx context.Context) (i *Image, err error)
	GetRandomWithSeed(ctx context.Context, seed int64) (i *Image, err error)
	ListAll(ctx context.Context) ([]Image, error)
	List(ctx context.Context, offset, limit int) ([]Image, error)
}

Provider is an interface for listing and retrieving images

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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