eveimage

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package eveimage provides cached access to images from the Eve Online image server.

Index

Constants

View Source
const (
	PlaceholderCharacterID   = 1
	PlaceholderCorporationID = 1
)

Variables

View Source
var (
	ErrHttpError   = errors.New("http error")
	ErrNoImage     = errors.New("no image from API")
	ErrInvalidSize = errors.New("invalid size")
)

Functions

func AllianceLogoURL

func AllianceLogoURL(id int32, size int) (string, error)

AllianceLogoURL returns an image URL for an alliance logo

func CharacterPortraitURL

func CharacterPortraitURL(id int32, size int) (string, error)

CharacterPortraitURL returns an image URL for a character portrait

func CorporationLogoURL

func CorporationLogoURL(id int32, size int) (string, error)

CorporationLogoURL returns an image URL for a corporation logo

func FactionLogoURL

func FactionLogoURL(id int32, size int) (string, error)

FactionLogoURL returns an image URL for a faction logo

func InventoryTypeBPCURL

func InventoryTypeBPCURL(id int32, size int) (string, error)

InventoryTypeBPCURL returns an image URL for inventory type bpc

func InventoryTypeBPOURL

func InventoryTypeBPOURL(id int32, size int) (string, error)

InventoryTypeBPOURL returns an image URL for inventory type bpo

func InventoryTypeIconURL

func InventoryTypeIconURL(id int32, size int) (string, error)

InventoryTypeIconURL returns an image URL for inventory type icon

func InventoryTypeRenderURL

func InventoryTypeRenderURL(id int32, size int) (string, error)

InventoryTypeRenderURL returns an image URL for inventory type render

Types

type EveImageService

type EveImageService struct {
	// contains filtered or unexported fields
}

EveImageService provides cached access to images on the Eve Online image server.

func New

func New(cacheDir string, httpClient *http.Client, isOffline bool) *EveImageService

New returns a new Images object. path is the location of the file cache. When no path is given (empty string) it will create a temporary directory instead. When no httpClient (nil) is provided it will use the default client. When isOffline is set to true, it will return a dummy image instead of trying to fetch images from the image server, which are not already cached.

func (m *EveImageService) AllianceLogo(id int32, size int) (fyne.Resource, error)

AllianceLogo returns the logo for an alliance.

func (*EveImageService) CharacterPortrait

func (m *EveImageService) CharacterPortrait(id int32, size int) (fyne.Resource, error)

CharacterPortrait returns the portrait for a character.

func (*EveImageService) ClearCache

func (m *EveImageService) ClearCache() (int, error)

ClearCache clears the images cache and returns the number of deleted entries.

func (m *EveImageService) CorporationLogo(id int32, size int) (fyne.Resource, error)

CorporationLogo returns the logo for a corporation.

func (*EveImageService) Count

func (m *EveImageService) Count() (int, error)

Count returns the number of all image files.

func (m *EveImageService) FactionLogo(id int32, size int) (fyne.Resource, error)

FactionLogo returns the logo for a faction.

func (*EveImageService) InventoryTypeBPC

func (m *EveImageService) InventoryTypeBPC(id int32, size int) (fyne.Resource, error)

InventoryTypeBPC returns the icon for a BPC type.

func (*EveImageService) InventoryTypeBPO

func (m *EveImageService) InventoryTypeBPO(id int32, size int) (fyne.Resource, error)

InventoryTypeBPO returns the icon for a BPO type.

func (*EveImageService) InventoryTypeIcon

func (m *EveImageService) InventoryTypeIcon(id int32, size int) (fyne.Resource, error)

InventoryTypeIcon returns the icon for a type.

func (*EveImageService) InventoryTypeRender

func (m *EveImageService) InventoryTypeRender(id int32, size int) (fyne.Resource, error)

InventoryTypeRender returns the render for a type. Note that not ever type has a render.

func (*EveImageService) InventoryTypeSKIN

func (m *EveImageService) InventoryTypeSKIN(id int32, size int) (fyne.Resource, error)

InventoryTypeSKIN returns the icon for a SKIN type.

func (*EveImageService) Size

func (m *EveImageService) Size() (int, error)

Size returns the total size of all image files in by bytes.

type HTTPError

type HTTPError struct {
	StatusCode int
	Status     string
}

func (HTTPError) Error

func (r HTTPError) Error() string

Jump to

Keyboard shortcuts

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