workshop

package
v0.0.0-...-54df73f Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client = http.Client{
	Timeout: 8 * time.Second,
}

Client is the default client to use for crawling.

View Source
var ErrFileNotFound = errors.New("workshop file not found")

ErrFileNotFound is returned instead of 404.

Functions

func SizedImageURL

func SizedImageURL(imageURL string, size int) string

SizedImageURL returns the image URL with the given size. It returns the original URL if it fails to do so.

Types

type File

type File struct {
	Title string
	Image string
}

File is a workshop shared file.

func CrawlFile

func CrawlFile(r io.Reader) (*File, error)

CrawlFile crawls the given reader for File.

func GetFile

func GetFile(id string) (*File, error)

GetFile gets a single file with the given ID.

func (File) SizedImageURL

func (f File) SizedImageURL(size int) string

SizedImageURL returns the image URL with the given size. It returns the original URL if it fails to do so.

Jump to

Keyboard shortcuts

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