eveimage

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2025 License: MIT Imports: 9 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 CacheService added in v0.12.0

type CacheService interface {
	Clear()
	Get(string) ([]byte, bool)
	Set(string, []byte, time.Duration)
}

Defines a cache service

type EveImageService

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

EveImageService represents a service which provides access to images on the Eve Online image server. Images are cached.

func New

func New(cache CacheService, httpClient *http.Client, isOffline bool) *EveImageService

New returns a new EveImageService.

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() 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) EntityIcon added in v0.13.0

func (s *EveImageService) EntityIcon(id int32, category string, size int) (fyne.Resource, error)

EntityIcon returns the icon for several entity categories.

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.

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