unsplash

package
Version: v0.0.0-...-b9c0c39 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRequestFailed = errors.New("request failed")

ErrRequestFailed indicates a general error in service request.

Functions

This section is empty.

Types

type Image

type Image struct {
	ID   string `json:"id"`
	URLs struct {
		Raw     string `json:"raw"`
		Full    string `json:"full"`
		Regular string `json:"regular"`
		Small   string `json:"small"`
		Thumb   string `json:"thumb"`
	} `json:"urls"`
	Location struct {
		City    string
		Country string
	}
	Description string
}

Image represents unsplash image information.

type Source

type Source struct {
	N           int
	Query       string
	Orientation string
	// contains filtered or unexported fields
}

Source is source implmentation for unsplash image service.

func (*Source) Fetch

func (s *Source) Fetch(index int) (string, io.ReadCloser, error)

Fetch fetches given index from source.

func (*Source) Init

func (s *Source) Init() (int, error)

Init initiates source and return number of available images.

func (*Source) Name

func (s *Source) Name() string

Name returns source name.

Source Files

Jump to

Keyboard shortcuts

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