phobos

package
v0.0.0-...-c14dfca Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: AGPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PreviewTypePixelPerfect = PreviewType(".png")
	PreviewTypeLargeJPEG    = PreviewType(".jpg")
	PreviewTypeHeightmap    = PreviewType("_h.png")
)

Variables

View Source
var (
	ErrBadPhobosAnswer = errors.New("phobos returned not 200 status code")
	ErrMultipleByHash  = errors.New("phobos responed with multiple maps")
	ErrNotFound        = errors.New("map is not found on phobos")
)

Functions

func FetchMapPreview

func FetchMapPreview(hash string, t PreviewType) (image.Image, error)

Types

type MapInfo

type MapInfo struct {
	MapName         string `json:"map_name"`
	MapSha          string `json:"map_sha"`
	MapSize         string `json:"map_size"`
	MapPlayers      int    `json:"map_players"`
	MapSpectators   int    `json:"map_spectators"`
	MapScavengers   int    `json:"map_scavengers"`
	MapOilwells     int    `json:"map_oilwells"`
	MapAuthor       string `json:"map_author"`
	MapLicense      string `json:"map_license"`
	MapType         string `json:"map_type"`
	MapScrX1        int    `json:"map_scr_x1"`
	MapScrY1        int    `json:"map_scr_y1"`
	MapScrX2        int    `json:"map_scr_x2"`
	MapScrY2        int    `json:"map_scr_y2"`
	MapAsymmetrical bool   `json:"map_asymmetrical"`
}

func FetchOnePhobosInfo

func FetchOnePhobosInfo(hash string) (MapInfo, error)

type PreviewType

type PreviewType string

Jump to

Keyboard shortcuts

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