unsplash

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrRateLimitExceeded occurs when rate limit is exceeded
	ErrRateLimitExceeded = errors.New("rate limit exceeded")
)

Functions

This section is empty.

Types

type App

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

App of package

func New

func New(config Config, redisApp redis.App, tracerApp tracer.App) App

New creates new App from Config

func (App) Get

func (a App) Get(ctx context.Context, id string) (Image, error)

Get from unsplash for given id

func (App) Search

func (a App) Search(ctx context.Context, query string) (Image, error)

Search from unsplash for given keyword

func (App) SendDownload

func (a App) SendDownload(ctx context.Context, content Image)

SendDownload event

type Config

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

Config of package

func Flags

func Flags(fs *flag.FlagSet, prefix string, overrides ...flags.Override) Config

Flags adds flags for configuring package

type Image

type Image struct {
	ID          string
	Raw         string
	URL         string
	DownloadURL string
	Author      string
	AuthorURL   string
}

Image describe an image use by app

func (Image) IsZero

func (i Image) IsZero() bool

IsZero checks if instance has value

Jump to

Keyboard shortcuts

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