Documentation ¶
Overview ¶
Package service contains the business logic
Index ¶
- Constants
- Variables
- type Service
- func (s *Service) AddEveEntitiesFromESISearch(characterID int32, search string) ([]int32, error)
- func (s *Service) AddMissingEveEntities(ctx context.Context, ids []int32) ([]int32, error)
- func (s *Service) DeleteMail(characterID, mailID int32) error
- func (s *Service) DeleteMyCharacter(characterID int32) error
- func (s *Service) DictionaryDelete(key string) error
- func (s *Service) DictionaryExists(key string) (bool, error)
- func (s *Service) DictionaryInt(key string) (int, error)
- func (s *Service) DictionarySetInt(key string, value int) error
- func (s *Service) DictionarySetString(key string, value string) error
- func (s *Service) DictionarySetTime(key string, value time.Time) error
- func (s *Service) DictionaryString(key string) (string, error)
- func (s *Service) DictionaryTime(key string) (time.Time, error)
- func (s *Service) FetchESIStatus() (string, error)
- func (s *Service) GetAnyMyCharacter() (model.MyCharacter, error)
- func (s *Service) GetMail(characterID int32, mailID int32) (model.Mail, error)
- func (s *Service) GetMailLabelUnreadCounts(characterID int32) (map[int32]int, error)
- func (s *Service) GetMailListUnreadCounts(characterID int32) (map[int32]int, error)
- func (s *Service) GetMyCharacter(characterID int32) (model.MyCharacter, error)
- func (s *Service) GetOrCreateEveCategoryESI(id int32) (*model.EveCategory, error)
- func (s *Service) GetOrCreateEveCharacterESI(id int32) (*model.EveCharacter, error)
- func (s *Service) GetOrCreateEveConstellationESI(id int32) (*model.EveConstellation, error)
- func (s *Service) GetOrCreateEveGroupESI(id int32) (*model.EveGroup, error)
- func (s *Service) GetOrCreateEveRegionESI(id int32) (*model.EveRegion, error)
- func (s *Service) GetOrCreateEveSolarSystemESI(id int32) (*model.EveSolarSystem, error)
- func (s *Service) GetOrCreateEveTypeESI(id int32) (*model.EveType, error)
- func (s *Service) ListEveEntitiesByPartialName(partial string) ([]*model.EveEntity, error)
- func (s *Service) ListMailIDsForLabelOrdered(characterID int32, labelID int32) ([]int32, error)
- func (s *Service) ListMailIDsForListOrdered(characterID int32, listID int32) ([]int32, error)
- func (s *Service) ListMailLabelsOrdered(characterID int32) ([]*model.MailLabel, error)
- func (s *Service) ListMailLists(characterID int32) ([]*model.EveEntity, error)
- func (s *Service) ListMyCharacters() ([]model.MyCharacterShort, error)
- func (s *Service) LoadMap() error
- func (s *Service) ResolveUncleanEveEntities(ee []*model.EveEntity) ([]*model.EveEntity, error)
- func (s *Service) SectionSetUpdated(characterID int32, section UpdateSection) error
- func (s *Service) SectionUpdatedAt(characterID int32, section UpdateSection) time.Time
- func (s *Service) SectionUpdatedExpired(characterID int32, section UpdateSection) bool
- func (s *Service) SendMail(characterID int32, subject string, recipients []*model.EveEntity, body string) (int32, error)
- func (s *Service) UpdateAllEveCharactersESI() error
- func (s *Service) UpdateMail(characterID int32) (int, error)
- func (s *Service) UpdateMailRead(characterID, mailID int32) error
- func (s *Service) UpdateMyCharacter(characterID int32) error
- func (s *Service) UpdateOrCreateMyCharacterFromSSO(ctx context.Context, infoText binding.ExternalString) error
- type UpdateSection
Constants ¶
const ( UpdateSectionMail = "mail" UpdateSectionMyCharacter = "my_character" )
Updated character sections
Variables ¶
var ErrEveEntityNameMultipleMatches = errors.New("multiple matching EveEntity names")
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 (*Service) AddEveEntitiesFromESISearch ¶
AddEveEntitiesFromESISearch runs a search on ESI and adds the results as new EveEntity objects to the database.
func (*Service) AddMissingEveEntities ¶
AddMissingEveEntities adds EveEntities from ESI for IDs missing in the database.
func (*Service) DeleteMail ¶
DeleteMail deletes a mail both on ESI and in the database.
func (*Service) DeleteMyCharacter ¶
func (*Service) DictionaryDelete ¶
DictionaryDelete deletes a key from the dictionary. If the key does not exist no error will be raised.
func (*Service) DictionaryExists ¶
DictionaryExists reports wether a key exists in the dictionary.
func (*Service) DictionaryInt ¶
DictionaryInt returns the int value for a dictionary key, when it exists. Otherwise it returns it's zero value.
func (*Service) DictionarySetInt ¶
DictionarySetInt sets the value for a dictionary int entry.
func (*Service) DictionarySetString ¶
DictionarySetString sets the value for a dictionary string entry.
func (*Service) DictionarySetTime ¶
DictionarySetTime sets the value for a dictionary time entry.
func (*Service) DictionaryString ¶
DictionaryString returns the value for a dictionary key, when it exists. Otherwise it returns it's zero value.
func (*Service) DictionaryTime ¶
DictionaryTime returns the time value for a dictionary key, when it exists. Otherwise it returns it's zero value.
func (*Service) FetchESIStatus ¶
func (*Service) GetAnyMyCharacter ¶
func (s *Service) GetAnyMyCharacter() (model.MyCharacter, error)
func (*Service) GetMailLabelUnreadCounts ¶
func (*Service) GetMailListUnreadCounts ¶
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 (*Service) GetOrCreateEveRegionESI ¶
func (*Service) GetOrCreateEveSolarSystemESI ¶
func (s *Service) GetOrCreateEveSolarSystemESI(id int32) (*model.EveSolarSystem, error)
func (*Service) GetOrCreateEveTypeESI ¶
func (*Service) ListEveEntitiesByPartialName ¶
func (*Service) ListMailIDsForLabelOrdered ¶
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 (*Service) ListMailLabelsOrdered ¶
func (*Service) ListMailLists ¶
func (*Service) ListMyCharacters ¶
func (s *Service) ListMyCharacters() ([]model.MyCharacterShort, error)
func (*Service) ResolveUncleanEveEntities ¶
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 ¶
UpdateAllEveCharactersESI updates all known Eve characters from ESI.
func (*Service) UpdateMail ¶
UpdateMail fetches and stores new mails from ESI for a character. It returns the number of unread mail.
func (*Service) UpdateMailRead ¶
UpdateMailRead updates an existing mail as read
func (*Service) UpdateMyCharacter ¶
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