fmtile

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: MIT Imports: 10 Imported by: 0

README

Golang Lastfm Tiler

GoDoc

Library and CLI tool for generating tiled grids of albums fetched from a LastFM user's charts.

As a Library

go get github.com/mjmaurer/lastfm-tiler-go

Then read the docs! (link above)

As a CLI command

go get github.com/mjmaurer/lastfm-tiler-go/cmd/lastfm-tiler

Then you can run: lastfm-tiler -h for options!

Documentation

Index

Constants

View Source
const FMTILE_POOL_SIZE string = "FMTILE_POOL_SIZE"

FMTILE_POOL_SIZE ... Set an environment variable with this name to an integer to indicate max parallelism for tiling operations (http request + resizing image) Default is 5.

Variables

This section is empty.

Functions

func MakeTiledGrid

func MakeTiledGrid(c *Config, lastfmID string) (image.Image, error)

MakeTiledGrid ... Returns an image.Image grid as specified by the Config. Will only fail in the case of Lastfm Api error. Otherwise, any tile specific errors will cause that tile to fill black (and be logged if enabled). See FMTILE_POOL_SIZE for concurrency control.

Types

type Config

type Config struct {
	LastfmAPIKey string      // [required]
	LastfmPeriod string      // overall|7day|1month|3month|6month|12month. Default 7day
	ImgSizePx    int         // One side of square album cover. Upscaling doesn't improve resolution. Default 300
	GridSize     int         // One side of tiled grid. Default 3
	Logger       *log.Logger // Default to DevNull
}

Config ... For MakeTiledGrid

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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