Documentation
¶
Overview ¶
Package eveimage provides cached access to images from the Eve Online image server.
Index ¶
- Constants
- Variables
- func AllianceLogoURL(id int32, size int) (string, error)
- func CharacterPortraitURL(id int32, size int) (string, error)
- func CorporationLogoURL(id int32, size int) (string, error)
- func FactionLogoURL(id int32, size int) (string, error)
- func InventoryTypeBPCURL(id int32, size int) (string, error)
- func InventoryTypeBPOURL(id int32, size int) (string, error)
- func InventoryTypeIconURL(id int32, size int) (string, error)
- func InventoryTypeRenderURL(id int32, size int) (string, error)
- type CacheService
- type EveImageService
- func (m *EveImageService) AllianceLogo(id int32, size int) (fyne.Resource, error)
- func (m *EveImageService) CharacterPortrait(id int32, size int) (fyne.Resource, error)
- func (m *EveImageService) ClearCache() error
- func (m *EveImageService) CorporationLogo(id int32, size int) (fyne.Resource, error)
- func (s *EveImageService) EntityIcon(id int32, category string, size int) (fyne.Resource, error)
- func (m *EveImageService) FactionLogo(id int32, size int) (fyne.Resource, error)
- func (m *EveImageService) InventoryTypeBPC(id int32, size int) (fyne.Resource, error)
- func (m *EveImageService) InventoryTypeBPO(id int32, size int) (fyne.Resource, error)
- func (m *EveImageService) InventoryTypeIcon(id int32, size int) (fyne.Resource, error)
- func (m *EveImageService) InventoryTypeRender(id int32, size int) (fyne.Resource, error)
- func (m *EveImageService) InventoryTypeSKIN(id int32, size int) (fyne.Resource, error)
- type HTTPError
Constants ¶
const ( PlaceholderCharacterID = 1 PlaceholderCorporationID = 1 )
Variables ¶
Functions ¶
func AllianceLogoURL ¶
AllianceLogoURL returns an image URL for an alliance logo
func CharacterPortraitURL ¶
CharacterPortraitURL returns an image URL for a character portrait
func CorporationLogoURL ¶
CorporationLogoURL returns an image URL for a corporation logo
func FactionLogoURL ¶
FactionLogoURL returns an image URL for a faction logo
func InventoryTypeBPCURL ¶
InventoryTypeBPCURL returns an image URL for inventory type bpc
func InventoryTypeBPOURL ¶
InventoryTypeBPOURL returns an image URL for inventory type bpo
func InventoryTypeIconURL ¶
InventoryTypeIconURL returns an image URL for inventory type icon
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 (*EveImageService) AllianceLogo ¶
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 (*EveImageService) CorporationLogo ¶
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 (*EveImageService) FactionLogo ¶
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.