service

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: 23 Imported by: 0

Documentation

Overview

Package service contains the business logic

Index

Constants

View Source
const (
	UpdateSectionMail        = "mail"
	UpdateSectionMyCharacter = "my_character"
)

Updated character sections

Variables

View Source
var ErrEveEntityNameMultipleMatches = errors.New("multiple matching EveEntity names")
View Source
var ErrEveEntityNameNoMatch = errors.New("no matching EveEntity name")

Functions

This section is empty.

Types

type Service

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

func NewService

func NewService(r *storage.Storage) *Service

func (*Service) AddEveEntitiesFromESISearch

func (s *Service) AddEveEntitiesFromESISearch(characterID int32, search string) ([]int32, error)

AddEveEntitiesFromESISearch runs a search on ESI and adds the results as new EveEntity objects to the database.

func (*Service) AddMissingEveEntities

func (s *Service) AddMissingEveEntities(ctx context.Context, ids []int32) ([]int32, error)

AddMissingEveEntities adds EveEntities from ESI for IDs missing in the database.

func (*Service) DeleteMail

func (s *Service) DeleteMail(characterID, mailID int32) error

DeleteMail deletes a mail both on ESI and in the database.

func (*Service) DeleteMyCharacter

func (s *Service) DeleteMyCharacter(characterID int32) error

func (*Service) DictionaryDelete

func (s *Service) DictionaryDelete(key string) error

DictionaryDelete deletes a key from the dictionary. If the key does not exist no error will be raised.

func (*Service) DictionaryExists

func (s *Service) DictionaryExists(key string) (bool, error)

DictionaryExists reports wether a key exists in the dictionary.

func (*Service) DictionaryInt

func (s *Service) DictionaryInt(key string) (int, error)

DictionaryInt returns the int value for a dictionary key, when it exists. Otherwise it returns it's zero value.

func (*Service) DictionarySetInt

func (s *Service) DictionarySetInt(key string, value int) error

DictionarySetInt sets the value for a dictionary int entry.

func (*Service) DictionarySetString

func (s *Service) DictionarySetString(key string, value string) error

DictionarySetString sets the value for a dictionary string entry.

func (*Service) DictionarySetTime

func (s *Service) DictionarySetTime(key string, value time.Time) error

DictionarySetTime sets the value for a dictionary time entry.

func (*Service) DictionaryString

func (s *Service) DictionaryString(key string) (string, error)

DictionaryString returns the value for a dictionary key, when it exists. Otherwise it returns it's zero value.

func (*Service) DictionaryTime

func (s *Service) DictionaryTime(key string) (time.Time, error)

DictionaryTime returns the time value for a dictionary key, when it exists. Otherwise it returns it's zero value.

func (*Service) FetchESIStatus

func (s *Service) FetchESIStatus() (string, error)

func (*Service) GetAnyMyCharacter

func (s *Service) GetAnyMyCharacter() (model.MyCharacter, error)

func (*Service) GetMail

func (s *Service) GetMail(characterID int32, mailID int32) (model.Mail, error)

func (*Service) GetMailLabelUnreadCounts

func (s *Service) GetMailLabelUnreadCounts(characterID int32) (map[int32]int, error)

func (*Service) GetMailListUnreadCounts

func (s *Service) GetMailListUnreadCounts(characterID int32) (map[int32]int, error)

func (*Service) GetMyCharacter

func (s *Service) GetMyCharacter(characterID int32) (model.MyCharacter, error)

func (*Service) GetOrCreateEveCategoryESI

func (s *Service) GetOrCreateEveCategoryESI(id int32) (*model.EveCategory, error)

func (*Service) GetOrCreateEveCharacterESI

func (s *Service) GetOrCreateEveCharacterESI(id int32) (*model.EveCharacter, error)

func (*Service) GetOrCreateEveConstellationESI

func (s *Service) GetOrCreateEveConstellationESI(id int32) (*model.EveConstellation, error)

func (*Service) GetOrCreateEveGroupESI

func (s *Service) GetOrCreateEveGroupESI(id int32) (*model.EveGroup, error)

func (*Service) GetOrCreateEveRegionESI

func (s *Service) GetOrCreateEveRegionESI(id int32) (*model.EveRegion, error)

func (*Service) GetOrCreateEveSolarSystemESI

func (s *Service) GetOrCreateEveSolarSystemESI(id int32) (*model.EveSolarSystem, error)

func (*Service) GetOrCreateEveTypeESI

func (s *Service) GetOrCreateEveTypeESI(id int32) (*model.EveType, error)

func (*Service) ListEveEntitiesByPartialName

func (s *Service) ListEveEntitiesByPartialName(partial string) ([]*model.EveEntity, error)

func (*Service) ListMailIDsForLabelOrdered

func (s *Service) ListMailIDsForLabelOrdered(characterID int32, labelID int32) ([]int32, error)

ListMailsForLabel returns a character's mails for a label in descending order by timestamp. Return mails for all labels, when labelID = 0

func (*Service) ListMailIDsForListOrdered

func (s *Service) ListMailIDsForListOrdered(characterID int32, listID int32) ([]int32, error)

func (*Service) ListMailLabelsOrdered

func (s *Service) ListMailLabelsOrdered(characterID int32) ([]*model.MailLabel, error)

func (*Service) ListMailLists

func (s *Service) ListMailLists(characterID int32) ([]*model.EveEntity, error)

func (*Service) ListMyCharacters

func (s *Service) ListMyCharacters() ([]model.MyCharacterShort, error)

func (*Service) LoadMap

func (s *Service) LoadMap() error

func (*Service) ResolveUncleanEveEntities

func (s *Service) ResolveUncleanEveEntities(ee []*model.EveEntity) ([]*model.EveEntity, error)

Resolve slice of unclean EveEntity objects and return as new slice with resolved objects. Will return an error if some entities can not be resolved.

func (*Service) SectionSetUpdated

func (s *Service) SectionSetUpdated(characterID int32, section UpdateSection) error

func (*Service) SectionUpdatedAt

func (s *Service) SectionUpdatedAt(characterID int32, section UpdateSection) time.Time

func (*Service) SectionUpdatedExpired

func (s *Service) SectionUpdatedExpired(characterID int32, section UpdateSection) bool

func (*Service) SendMail

func (s *Service) SendMail(characterID int32, subject string, recipients []*model.EveEntity, body string) (int32, error)

SendMail creates a new mail on ESI and stores it locally.

func (*Service) UpdateAllEveCharactersESI

func (s *Service) UpdateAllEveCharactersESI() error

UpdateAllEveCharactersESI updates all known Eve characters from ESI.

func (*Service) UpdateMail

func (s *Service) UpdateMail(characterID int32) (int, error)

UpdateMail fetches and stores new mails from ESI for a character. It returns the number of unread mail.

func (*Service) UpdateMailRead

func (s *Service) UpdateMailRead(characterID, mailID int32) error

UpdateMailRead updates an existing mail as read

func (*Service) UpdateMyCharacter

func (s *Service) UpdateMyCharacter(characterID int32) error

func (*Service) UpdateOrCreateMyCharacterFromSSO

func (s *Service) UpdateOrCreateMyCharacterFromSSO(ctx context.Context, infoText binding.ExternalString) error

UpdateOrCreateMyCharacterFromSSO creates or updates a character via SSO authentication.

type UpdateSection

type UpdateSection string

Jump to

Keyboard shortcuts

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