eveimageservice

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package eveimageservice contains the EVE image service.

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")
	ErrInvalid   = errors.New("invalid")
)

Functions

func AllianceLogoURL

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

AllianceLogoURL returns an image URL for an alliance logo

func CharacterPortraitURL

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

CharacterPortraitURL returns an image URL for a character portrait

func CorporationLogoURL

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

CorporationLogoURL returns an image URL for a corporation logo

func FactionLogoURL

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

FactionLogoURL returns an image URL for a faction logo

func InventoryTypeBPCURL

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

InventoryTypeBPCURL returns an image URL for inventory type bpc

func InventoryTypeBPOURL

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

InventoryTypeBPOURL returns an image URL for inventory type bpo

func InventoryTypeIconURL

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

InventoryTypeIconURL returns an image URL for inventory type icon

func InventoryTypeRenderURL

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

InventoryTypeRenderURL returns an image URL for inventory type render

Types

type CacheService

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

CacheService 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 (s *EveImageService) AllianceLogo(id int64, size int) (fyne.Resource, error)

AllianceLogo returns the logo for an alliance.

func (*EveImageService) AllianceLogoAsync added in v0.57.0

func (s *EveImageService) AllianceLogoAsync(id int64, size int, setter func(r fyne.Resource))

AllianceLogoAsync loads an alliance logo asynchronously and calls setter with the result.

func (*EveImageService) CharacterPortrait

func (s *EveImageService) CharacterPortrait(id int64, size int) (fyne.Resource, error)

CharacterPortrait returns the portrait for a character.

func (*EveImageService) CharacterPortraitAsync added in v0.57.0

func (s *EveImageService) CharacterPortraitAsync(id int64, size int, setter func(r fyne.Resource))

CharacterPortraitAsync loads a character portrait asynchronously and calls setter with the result.

func (s *EveImageService) CorporationLogo(id int64, size int) (fyne.Resource, error)

CorporationLogo returns the logo for a corporation.

func (*EveImageService) CorporationLogoAsync added in v0.57.0

func (s *EveImageService) CorporationLogoAsync(id int64, size int, setter func(r fyne.Resource))

CorporationLogoAsync loads a character portrait asynchronously and calls setter with the result.

func (s *EveImageService) FactionLogo(id int64, size int) (fyne.Resource, error)

FactionLogo returns the logo for a faction.

func (*EveImageService) FactionLogoAsync added in v0.57.0

func (s *EveImageService) FactionLogoAsync(id int64, size int, setter func(r fyne.Resource))

FactionLogoAsync loads a faction logo asynchronously and calls setter with the result.

func (*EveImageService) InventoryTypeBPC

func (s *EveImageService) InventoryTypeBPC(id int64, size int) (fyne.Resource, error)

InventoryTypeBPC returns the icon for a BPC type.

func (*EveImageService) InventoryTypeBPCAsync added in v0.57.0

func (s *EveImageService) InventoryTypeBPCAsync(id int64, size int, setter func(r fyne.Resource))

InventoryTypeBPCAsync loads the icon for a BPC type and calls setter with the result.

func (*EveImageService) InventoryTypeBPO

func (s *EveImageService) InventoryTypeBPO(id int64, size int) (fyne.Resource, error)

InventoryTypeBPO returns the icon for a BPO type.

func (*EveImageService) InventoryTypeBPOAsync added in v0.57.0

func (s *EveImageService) InventoryTypeBPOAsync(id int64, size int, setter func(r fyne.Resource))

InventoryTypeBPOAsync loads the icon for a BPO type and calls setter with the result.

func (*EveImageService) InventoryTypeIcon

func (s *EveImageService) InventoryTypeIcon(id int64, size int) (fyne.Resource, error)

InventoryTypeIcon returns the icon for a type.

func (*EveImageService) InventoryTypeIconAsync added in v0.57.0

func (s *EveImageService) InventoryTypeIconAsync(id int64, size int, setter func(r fyne.Resource))

InventoryTypeIconAsync loads a render for a type and calls setter with the result.

func (*EveImageService) InventoryTypeRender

func (s *EveImageService) InventoryTypeRender(id int64, size int) (fyne.Resource, error)

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

func (*EveImageService) InventoryTypeRenderAsync added in v0.57.0

func (s *EveImageService) InventoryTypeRenderAsync(id int64, size int, setter func(r fyne.Resource))

InventoryTypeRenderAsync loads a render for a type and calls setter with the result.

func (*EveImageService) InventoryTypeSKIN

func (s *EveImageService) InventoryTypeSKIN(id int64, size int) (fyne.Resource, error)

InventoryTypeSKIN returns the icon for a SKIN type.

func (*EveImageService) InventoryTypeSKINAsync added in v0.57.0

func (s *EveImageService) InventoryTypeSKINAsync(id int64, size int, setter func(r fyne.Resource))

InventoryTypeSKINAsync loads the icon for a SKIN type and calls setter with the result.

type HTTPError

type HTTPError struct {
	StatusCode int
	Status     string
}

HTTPError represents a HTTP response with status code >= 400.

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