model

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package model contains the entity objects, which are used across the app.

Package model contains the entity objects, which are used across the app.

Index

Constants

View Source
const (
	MailLabelAll      = 1<<31 - 1
	MailLabelNone     = 0
	MailLabelInbox    = 1
	MailLabelSent     = 2
	MailLabelCorp     = 4
	MailLabelAlliance = 8
)

Special mail label IDs

View Source
const (
	SettingLastCharacterID = "lastCharacterID"
	SettingMaxMails        = "maxMails"
)

Setting keys

View Source
const (
	SettingMaxMailsDefault = 1000
)

Default settings

Variables

This section is empty.

Functions

This section is empty.

Types

type EveCategory

type EveCategory struct {
	ID          int32
	IsPublished bool
	Name        string
}

EveCategory is a category in Eve Online.

type EveCharacter

type EveCharacter struct {
	Alliance       *EveEntity
	Birthday       time.Time
	Corporation    *EveEntity
	Description    string
	Faction        *EveEntity
	Gender         string
	ID             int32
	Name           string
	Race           *EveRace
	SecurityStatus float64
	Title          string
}

An Eve Online character.

func (*EveCharacter) AllianceName

func (c *EveCharacter) AllianceName() string

func (*EveCharacter) FactionName

func (c *EveCharacter) FactionName() string

func (*EveCharacter) HasAlliance

func (c *EveCharacter) HasAlliance() bool

HasAlliance reports wether the character is member of an alliance.

func (*EveCharacter) HasFaction

func (c *EveCharacter) HasFaction() bool

HasFaction reports wether the character is member of a faction.

func (*EveCharacter) PortraitURL

func (c *EveCharacter) PortraitURL(size int) (fyne.URI, error)

PortraitURL returns an image URL for a portrait of a character

type EveConstellation

type EveConstellation struct {
	ID     int32
	Name   string
	Region *EveRegion
}

EveConstellation is a constellation in Eve Online.

type EveEntity

type EveEntity struct {
	Category EveEntityCategory
	ID       int32
	Name     string
}

An EveEntity in EveOnline.

func (*EveEntity) IconURL

func (e *EveEntity) IconURL(size int) (fyne.URI, error)

IconURL returns the URL for an icon image of an entity.

type EveEntityCategory

type EveEntityCategory int
const (
	EveEntityUndefined EveEntityCategory = iota
	EveEntityAlliance
	EveEntityCharacter
	EveEntityConstellation
	EveEntityCorporation
	EveEntityFaction
	EveEntityInventoryType
	EveEntityMailList
	EveEntityRegion
	EveEntitySolarSystem
	EveEntityStation
	EveEntityUnknown
)

Supported categories of EveEntity

func (EveEntityCategory) String

func (e EveEntityCategory) String() string

type EveGroup

type EveGroup struct {
	ID          int32
	Category    *EveCategory
	IsPublished bool
	Name        string
}

EveGroup is a group in Eve Online.

type EveRace

type EveRace struct {
	Description string
	Name        string
	ID          int32
}

func (*EveRace) FactionID

func (r *EveRace) FactionID() (int32, bool)

func (*EveRace) IconURL

func (r *EveRace) IconURL(size int) (fyne.URI, error)

IconURL returns the URL for an icon image of a race.

type EveRegion

type EveRegion struct {
	Description string
	ID          int32
	Name        string
}

EveRegion is a region in Eve Online.

type EveSolarSystem

type EveSolarSystem struct {
	Constellation  *EveConstellation
	ID             int32
	Name           string
	SecurityStatus float64
}

EveSolarSystem is a solar system in Eve Online.

type EveType

type EveType struct {
	ID          int32
	Description string
	Group       *EveGroup
	IsPublished bool
	Name        string
}

EveType is a type in Eve Online.

func (*EveType) IconURL

func (t *EveType) IconURL(size int) (fyne.URI, error)

IconURL returns the URL for an icon image of a type.

type Mail

type Mail struct {
	Body          string
	MyCharacterID int32
	From          *EveEntity
	Labels        []*MailLabel
	IsRead        bool
	ID            int64
	MailID        int32
	Recipients    []*EveEntity
	Subject       string
	Timestamp     time.Time
}

An Eve mail belonging to a character.

func (*Mail) BodyPlain

func (m *Mail) BodyPlain() string

BodyPlain returns a mail's body as plain text.

func (*Mail) MakeHeaderText

func (m *Mail) MakeHeaderText(format string) string

MakeHeaderText returns the mail's header as formatted text.

func (*Mail) RecipientNames

func (m *Mail) RecipientNames() []string

RecipientNames returns the names of the recipients.

func (*Mail) ToString

func (m *Mail) ToString(format string) string

BodyForward returns a mail's body for a mail forward or reply.

type MailLabel

type MailLabel struct {
	ID            int64
	MyCharacterID int32
	Color         string
	LabelID       int32
	Name          string
	UnreadCount   int
}

A mail label for an Eve mail belonging to a character.

type MyCharacter

type MyCharacter struct {
	Character     *EveCharacter
	ID            int32
	LastLoginAt   time.Time
	Location      *EveSolarSystem
	Ship          *EveType
	SkillPoints   int
	WalletBalance float64
}

An owned character in Eve Online.

func (*MyCharacter) PortraitURL

func (c *MyCharacter) PortraitURL(size int) (fyne.URI, error)

PortraitURL returns an image URL for a portrait of a character

type MyCharacterShort

type MyCharacterShort struct {
	ID   int32
	Name string
}

type Token

type Token struct {
	AccessToken  string
	CharacterID  int32
	ExpiresAt    time.Time
	RefreshToken string
	TokenType    string
}

A SSO token belonging to a character in Eve Online.

func (*Token) RemainsValid

func (t *Token) RemainsValid(d time.Duration) bool

RemainsValid reports wether a token remains valid within a duration.

Jump to

Keyboard shortcuts

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