source

package
v0.0.0-...-8ee1577 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package source defines the common interface and shared logic for wallpaper providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(ctx context.Context, client *resty.Client, path, prefix string, images []Image, set bool) error

Download fetches images concurrently and saves them to disk. It uses errgroup for goroutine management and error propagation. When set is true, one of the downloaded images (chosen at random) is applied as the desktop wallpaper once all downloads have finished.

Types

type DownloadFailedError

type DownloadFailedError struct {
	Name       string
	StatusCode int
}

DownloadFailedError indicates that downloading an image failed with a non-2xx status.

func (*DownloadFailedError) Error

func (e *DownloadFailedError) Error() string

type Image

type Image struct {
	Name string
	URL  string
}

Image represents a downloadable wallpaper with a name and URL.

type Source

type Source interface {
	Fetch(ctx context.Context) error
}

Source represents a wallpaper provider that can fetch images.

Jump to

Keyboard shortcuts

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