Documentation
¶
Overview ¶
Package characterservice contains the EVE character service.
Index ¶
- type AuthClient
- type Cache
- type CharacterService
- func (s *CharacterService) AddEveEntitiesFromSearchESI(ctx context.Context, characterID int64, search string) (set.Set[int64], error)
- func (s *CharacterService) AddTagToCharacter(ctx context.Context, characterID int64, tagID int64) error
- func (s *CharacterService) AssetTotalValue(ctx context.Context, characterID int64) (optional.Optional[float64], error)
- func (s *CharacterService) CharacterNames(ctx context.Context) (map[int64]string, error)
- func (s *CharacterService) CharactersWithMissingScopes(ctx context.Context) ([]*app.EntityShort, error)
- func (s *CharacterService) CountAllMailsUnread(ctx context.Context) (int, error)
- func (s *CharacterService) CountAllMailsUnreadByLabel(ctx context.Context) (map[int64]int, error)
- func (s *CharacterService) CountAllMailsUnreadByList(ctx context.Context) (map[int64]int, error)
- func (s *CharacterService) CountAllMailsWithoutBody(ctx context.Context) (total int, missing int, err error)
- func (s *CharacterService) CountCharactersWithSection(ctx context.Context, section app.CharacterSection) (int, error)
- func (s *CharacterService) CountMails(ctx context.Context, characterID int64) (int, int, error)
- func (s *CharacterService) CountMailsUnread(ctx context.Context, characterID int64) (int, error)
- func (s *CharacterService) CountMailsUnreadByLabel(ctx context.Context, characterID int64) (map[int64]int, error)
- func (s *CharacterService) CountMailsUnreadByList(ctx context.Context, characterID int64) (map[int64]int, error)
- func (s *CharacterService) CountMailsWithoutBody(ctx context.Context, characterID int64) (total int, missing int, err error)
- func (s *CharacterService) CreateTag(ctx context.Context, name string) (*app.CharacterTag, error)
- func (s *CharacterService) DeleteAllTags(ctx context.Context) error
- func (s *CharacterService) DeleteCharacter(ctx context.Context, characterID int64) (bool, error)
- func (s *CharacterService) DeleteMail(ctx context.Context, characterID, mailID int64) error
- func (s *CharacterService) DeleteTag(ctx context.Context, id int64) error
- func (s *CharacterService) DownloadMissingMailBodies(ctx context.Context, characterID int64) (bool, error)
- func (s *CharacterService) DumpData(tables ...string) string
- func (s *CharacterService) ForecastPlanet(cp *app.CharacterPlanet, now time.Time) *app.ColonyForecast
- func (s *CharacterService) GetAnyCharacter(ctx context.Context) (*app.Character, error)
- func (s *CharacterService) GetAttributes(ctx context.Context, characterID int64) (*app.CharacterAttributes, error)
- func (s *CharacterService) GetCharacter(ctx context.Context, id int64) (*app.Character, error)
- func (s *CharacterService) GetCharacterIndustryJob(ctx context.Context, characterID, jobID int64) (*app.CharacterIndustryJob, error)
- func (s *CharacterService) GetContract(ctx context.Context, characterID, contractID int64) (*app.CharacterContract, error)
- func (s *CharacterService) GetContractBidSummary(ctx context.Context, contractID int64) (int, optional.Optional[*app.ContractBid], error)
- func (s *CharacterService) GetJumpClone(ctx context.Context, characterID, cloneID int64) (*app.CharacterJumpClone, error)
- func (s *CharacterService) GetMail(ctx context.Context, characterID int64, mailID int64) (*app.CharacterMail, error)
- func (s *CharacterService) GetNotification(ctx context.Context, characterID, notificationID int64) (*app.CharacterNotification, error)
- func (s *CharacterService) GetPlanet(ctx context.Context, characterID, planetID int64) (*app.CharacterPlanet, error)
- func (s *CharacterService) GetSkill(ctx context.Context, characterID, typeID int64) (*app.CharacterSkill, error)
- func (s *CharacterService) GetWalletJournalEntry(ctx context.Context, characterID int64, refID int64) (*app.CharacterWalletJournalEntry, error)
- func (s *CharacterService) GetWalletTransactions(ctx context.Context, characterID int64, transactionID int64) (*app.CharacterWalletTransaction, error)
- func (s *CharacterService) HasCharacter(ctx context.Context, id int64) (bool, error)
- func (s *CharacterService) HasSection(ctx context.Context, characterID int64, section app.CharacterSection) (bool, error)
- func (s *CharacterService) HasTokenWithScopes(ctx context.Context, characterID int64, scopes set.Set[string]) (bool, error)
- func (s *CharacterService) Init(ctx context.Context) error
- func (s *CharacterService) IsTrainingActive(ctx context.Context, characterID int64) (bool, error)
- func (s *CharacterService) ListAllAssets(ctx context.Context) ([]*app.CharacterAsset, error)
- func (s *CharacterService) ListAllCharacterContractSlotsCorporation(ctx context.Context) ([]app.CharacterContractSlots, error)
- func (s *CharacterService) ListAllCharacterContractSlotsPersonal(ctx context.Context) ([]app.CharacterContractSlots, error)
- func (s *CharacterService) ListAllCharacterIndustryJob(ctx context.Context) ([]*app.CharacterIndustryJob, error)
- func (s *CharacterService) ListAllCharactersIndustrySlots(ctx context.Context, typ app.IndustryJobType) ([]app.CharacterIndustrySlots, error)
- func (s *CharacterService) ListAllContracts(ctx context.Context) ([]*app.CharacterContract, error)
- func (s *CharacterService) ListAllImplants(ctx context.Context) ([]*app.CharacterImplant, error)
- func (s *CharacterService) ListAllJumpClones(ctx context.Context) ([]*app.CharacterJumpClone2, error)
- func (s *CharacterService) ListAllLoyaltyPointEntries(ctx context.Context) ([]*app.CharacterLoyaltyPointEntry, error)
- func (s *CharacterService) ListAllMailHeadersForLabelOrdered(ctx context.Context, labelID int64) ([]*app.CharacterMailHeader, error)
- func (s *CharacterService) ListAllMailHeadersForListOrdered(ctx context.Context, listID int64) ([]*app.CharacterMailHeader, error)
- func (s *CharacterService) ListAllMailLists(ctx context.Context) ([]*app.EveEntity, error)
- func (s *CharacterService) ListAllMarketOrder(ctx context.Context, isBuyOrders bool) ([]*app.CharacterMarketOrder, error)
- func (s *CharacterService) ListAllNotifications(ctx context.Context) ([]*app.CharacterNotification, error)
- func (s *CharacterService) ListAllPlanets(ctx context.Context) ([]*app.CharacterPlanet, error)
- func (s *CharacterService) ListAllSkills(ctx context.Context) ([]*app.CharacterSkill, error)
- func (s *CharacterService) ListAssets(ctx context.Context, characterID int64) ([]*app.CharacterAsset, error)
- func (s *CharacterService) ListCharacterCorporationIDs(ctx context.Context) (set.Set[int64], error)
- func (s *CharacterService) ListCharacterCorporations(ctx context.Context) ([]*app.EntityShort, error)
- func (s *CharacterService) ListCharacterIDs(ctx context.Context) (set.Set[int64], error)
- func (s *CharacterService) ListCharacters(ctx context.Context) ([]*app.Character, error)
- func (s *CharacterService) ListCharactersForTag(ctx context.Context, tagID int64) (tagged []*app.EntityShort, others []*app.EntityShort, err error)
- func (s *CharacterService) ListCharactersShort(ctx context.Context) ([]*app.EntityShort, error)
- func (s *CharacterService) ListContacts(ctx context.Context, characterID int64) ([]*app.CharacterContact, error)
- func (s *CharacterService) ListContractItems(ctx context.Context, contractID int64) ([]*app.ContractItem, error)
- func (s *CharacterService) ListEveCharacters(ctx context.Context) ([]*app.EveCharacter, error)
- func (s *CharacterService) ListImplants(ctx context.Context, characterID int64) ([]*app.CharacterImplant, error)
- func (s *CharacterService) ListJumpClones(ctx context.Context, characterID int64) ([]*app.CharacterJumpClone, error)
- func (s *CharacterService) ListLoyaltyPointEntries(ctx context.Context, characterID int64) ([]*app.CharacterLoyaltyPointEntry, error)
- func (s *CharacterService) ListMailHeadersForLabelOrdered(ctx context.Context, characterID int64, labelID int64) ([]*app.CharacterMailHeader, error)
- func (s *CharacterService) ListMailHeadersForListOrdered(ctx context.Context, characterID int64, listID int64) ([]*app.CharacterMailHeader, error)
- func (s *CharacterService) ListMailLabelsOrdered(ctx context.Context, characterID int64) ([]*app.CharacterMailLabel, error)
- func (s *CharacterService) ListMailLists(ctx context.Context, characterID int64) ([]*app.EveEntity, error)
- func (s *CharacterService) ListNotifications(ctx context.Context, characterID int64) ([]*app.CharacterNotification, error)
- func (s *CharacterService) ListPlanets(ctx context.Context, characterID int64) ([]*app.CharacterPlanet, error)
- func (s *CharacterService) ListRoles(ctx context.Context, characterID int64) ([]app.CharacterRole, error)
- func (s *CharacterService) ListShipsAbilities(ctx context.Context, characterID int64) ([]*app.CharacterShipAbility, error)
- func (s *CharacterService) ListSkillqueueItems(ctx context.Context, characterID int64) ([]*app.CharacterSkillqueueItem, error)
- func (s *CharacterService) ListSkills(ctx context.Context, characterID int64) ([]*app.CharacterSkill2, error)
- func (s *CharacterService) ListTagsByName(ctx context.Context) ([]*app.CharacterTag, error)
- func (s *CharacterService) ListTagsForCharacter(ctx context.Context, characterID int64) (set.Set[string], error)
- func (s *CharacterService) ListWalletJournalEntries(ctx context.Context, characterID int64) ([]*app.CharacterWalletJournalEntry, error)
- func (s *CharacterService) ListWalletTransactions(ctx context.Context, characterID int64) ([]*app.CharacterWalletTransaction, error)
- func (s *CharacterService) MissingScopes(ctx context.Context, characterID int64, scopes set.Set[string]) (set.Set[string], error)
- func (s *CharacterService) NotifyExpiredTrainingForWatched(ctx context.Context, characterID int64, notify func(title, content string)) error
- func (s *CharacterService) NotifyMails(ctx context.Context, characterID int64, earliest time.Time, ...) error
- func (s *CharacterService) NotifyNotifications(ctx context.Context, characterID int64, earliest time.Time, ...) error
- func (s *CharacterService) NotifyStoppedColonies(ctx context.Context, characterID int64, earliest time.Time, ...) error
- func (s *CharacterService) NotifyUpdatedContracts(ctx context.Context, characterID int64, earliest time.Time, ...) error
- func (s *CharacterService) ReadAndReplaceTags(ctx context.Context, reader io.Reader, version string) error
- func (s *CharacterService) RemoveTagFromCharacter(ctx context.Context, characterID int64, tagID int64) error
- func (s *CharacterService) RenameTag(ctx context.Context, id int64, name string) error
- func (s *CharacterService) SearchESI(ctx context.Context, search string, categories []app.SearchCategory, ...) (map[app.SearchCategory][]*app.EveEntity, int, error)
- func (s *CharacterService) SendDesktopNotification(ctx context.Context, n *app.CharacterNotification) error
- func (s *CharacterService) SendMail(ctx context.Context, characterID int64, subject string, ...) (int64, error)
- func (s *CharacterService) SetMailReadLocal(ctx context.Context, characterID, mailID int64, isRead bool) error
- func (s *CharacterService) SetNotificationsAsRead(ctx context.Context, ids set.Set[int64]) error
- func (s *CharacterService) Start(d time.Duration)
- func (s *CharacterService) Stop()
- func (s *CharacterService) TokenSource(ctx context.Context, characterID int64, scopes set.Set[string]) (oauth2.TokenSource, error)
- func (s *CharacterService) TokenSourceForCorporation(ctx context.Context, corporationID int64, roles set.Set[app.Role], ...) (oauth2.TokenSource, int64, error)
- func (s *CharacterService) TotalTrainingTime(ctx context.Context, characterID int64) (optional.Optional[time.Duration], error)
- func (s *CharacterService) UpdateAllCalculatedValues(ctx context.Context) error
- func (s *CharacterService) UpdateAllCalculatedValuesAsync()
- func (s *CharacterService) UpdateCharacterAndRefreshIfNeededAsync(characterID int64, forceUpdate bool)
- func (s *CharacterService) UpdateCharacterSectionAndRefreshIfNeededAsync(characterID int64, section app.CharacterSection, forceUpdate bool)
- func (s *CharacterService) UpdateCharactersIfNeededAsync(forceUpdate bool)
- func (s *CharacterService) UpdateIsTrainingWatched(ctx context.Context, characterID int64, v bool) error
- func (s *CharacterService) UpdateMailBodyESI(ctx context.Context, characterID int64, mailID int64) (string, error)
- func (s *CharacterService) UpdateMailRead(ctx context.Context, characterID, mailID int64, isRead bool) error
- func (s *CharacterService) UpdateOrCreateCharacterFromSSO(ctx context.Context, setInfo func(s string)) (*app.Character, error)
- func (s *CharacterService) WriteNotificationTypeFixtures(ctx context.Context, writer io.Writer) error
- func (s *CharacterService) WriteTags(ctx context.Context, writer io.Writer, version string) error
- type EVENotificationService
- type Params
- type Settings
- type StatusCache
- type TagsExported
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthClient ¶ added in v0.50.1
type Cache ¶ added in v0.51.1
type Cache interface {
Delete(string)
GetInt64(string) (int64, bool)
GetString(string) (string, bool)
SetInt64(string, int64, time.Duration)
SetString(string, string, time.Duration)
}
Cache defines a cache.
type CharacterService ¶
type CharacterService struct {
// contains filtered or unexported fields
}
CharacterService provides access to all managed EVE Online characters both online and from local storage.
func New ¶
func New(arg Params) *CharacterService
New creates a new character service and returns it. When nil is passed for any parameter a new default instance will be created for it (except for storage).
func (*CharacterService) AddEveEntitiesFromSearchESI ¶ added in v0.21.0
func (s *CharacterService) AddEveEntitiesFromSearchESI(ctx context.Context, characterID int64, search string) (set.Set[int64], error)
AddEveEntitiesFromSearchESI runs a search on ESI and adds the results as new EveEntity objects to the database. This method performs a character specific search and needs a token.
func (*CharacterService) AddTagToCharacter ¶ added in v0.30.0
func (*CharacterService) AssetTotalValue ¶ added in v0.21.0
func (*CharacterService) CharacterNames ¶ added in v0.60.0
CharacterNames returns an ID to name map for all existing characters.
func (*CharacterService) CharactersWithMissingScopes ¶ added in v0.43.0
func (s *CharacterService) CharactersWithMissingScopes(ctx context.Context) ([]*app.EntityShort, error)
CharactersWithMissingScopes returns a list of characters which are missing scopes (if any),
func (*CharacterService) CountAllMailsUnread ¶ added in v0.77.0
func (s *CharacterService) CountAllMailsUnread(ctx context.Context) (int, error)
func (*CharacterService) CountAllMailsUnreadByLabel ¶ added in v0.77.0
func (*CharacterService) CountAllMailsUnreadByList ¶ added in v0.77.0
func (*CharacterService) CountAllMailsWithoutBody ¶ added in v0.77.0
func (s *CharacterService) CountAllMailsWithoutBody(ctx context.Context) (total int, missing int, err error)
CountAllMailsWithoutBody returns the total number of mails and the number of mails without body for all characters.
func (*CharacterService) CountCharactersWithSection ¶ added in v0.77.0
func (s *CharacterService) CountCharactersWithSection(ctx context.Context, section app.CharacterSection) (int, error)
CountCharactersWithSection returns the number of characters for which a section has been completed at least once.
func (*CharacterService) CountMails ¶ added in v0.77.0
CountMails returns the total and unread number of mails for a character.
func (*CharacterService) CountMailsUnread ¶ added in v0.77.0
func (*CharacterService) CountMailsUnreadByLabel ¶ added in v0.77.0
func (*CharacterService) CountMailsUnreadByList ¶ added in v0.77.0
func (*CharacterService) CountMailsWithoutBody ¶ added in v0.77.0
func (s *CharacterService) CountMailsWithoutBody(ctx context.Context, characterID int64) (total int, missing int, err error)
CountMailsWithoutBody returns the total number of mails and the number of mails without body for a character.
func (*CharacterService) CreateTag ¶ added in v0.30.0
func (s *CharacterService) CreateTag(ctx context.Context, name string) (*app.CharacterTag, error)
func (*CharacterService) DeleteAllTags ¶ added in v0.56.0
func (s *CharacterService) DeleteAllTags(ctx context.Context) error
func (*CharacterService) DeleteCharacter ¶
DeleteCharacter deletes a character and potentially also its corporation when it becomes orphaned. It reports whether its corporation was also deleted.
func (*CharacterService) DeleteMail ¶ added in v0.21.0
func (s *CharacterService) DeleteMail(ctx context.Context, characterID, mailID int64) error
DeleteMail deletes a mail both on ESI and in the database.
func (*CharacterService) DeleteTag ¶ added in v0.30.0
func (s *CharacterService) DeleteTag(ctx context.Context, id int64) error
func (*CharacterService) DownloadMissingMailBodies ¶ added in v0.51.0
func (s *CharacterService) DownloadMissingMailBodies(ctx context.Context, characterID int64) (bool, error)
DownloadMissingMailBodies downloads missing mail bodies for a character and reports whether the function was aborted. Only one instance per character will run at a time and additional calls will be aborted.
func (*CharacterService) DumpData ¶ added in v0.40.0
func (s *CharacterService) DumpData(tables ...string) string
DumpData returns the current content of the given SQL tables as JSON string. When no tables are given all tables will be included. This is a low-level method meant mainly for debugging.
func (*CharacterService) ForecastPlanet ¶ added in v0.76.0
func (s *CharacterService) ForecastPlanet(cp *app.CharacterPlanet, now time.Time) *app.ColonyForecast
ForecastPlanet returns the estimated state of a colony at now, simulated forward from its last ESI snapshot. Forecasts are reused while the colony data is unchanged and the forecast stays the same. The returned forecast must not be modified.
func (*CharacterService) GetAnyCharacter ¶
func (*CharacterService) GetAttributes ¶ added in v0.21.0
func (s *CharacterService) GetAttributes(ctx context.Context, characterID int64) (*app.CharacterAttributes, error)
func (*CharacterService) GetCharacter ¶
GetCharacter returns a character from storage and updates calculated fields.
func (*CharacterService) GetCharacterIndustryJob ¶ added in v0.30.0
func (s *CharacterService) GetCharacterIndustryJob(ctx context.Context, characterID, jobID int64) (*app.CharacterIndustryJob, error)
func (*CharacterService) GetContract ¶ added in v0.28.0
func (s *CharacterService) GetContract(ctx context.Context, characterID, contractID int64) (*app.CharacterContract, error)
GetContract fetches and returns a contract from the database.
func (*CharacterService) GetContractBidSummary ¶ added in v0.77.0
func (s *CharacterService) GetContractBidSummary(ctx context.Context, contractID int64) (int, optional.Optional[*app.ContractBid], error)
GetContractBidSummary returns the number of bids on a contract and its top bid, if any.
func (*CharacterService) GetJumpClone ¶ added in v0.21.0
func (s *CharacterService) GetJumpClone(ctx context.Context, characterID, cloneID int64) (*app.CharacterJumpClone, error)
func (*CharacterService) GetMail ¶ added in v0.21.0
func (s *CharacterService) GetMail(ctx context.Context, characterID int64, mailID int64) (*app.CharacterMail, error)
func (*CharacterService) GetNotification ¶ added in v0.69.0
func (s *CharacterService) GetNotification(ctx context.Context, characterID, notificationID int64) (*app.CharacterNotification, error)
func (*CharacterService) GetPlanet ¶ added in v0.28.0
func (s *CharacterService) GetPlanet(ctx context.Context, characterID, planetID int64) (*app.CharacterPlanet, error)
func (*CharacterService) GetSkill ¶ added in v0.21.0
func (s *CharacterService) GetSkill(ctx context.Context, characterID, typeID int64) (*app.CharacterSkill, error)
func (*CharacterService) GetWalletJournalEntry ¶ added in v0.30.0
func (s *CharacterService) GetWalletJournalEntry(ctx context.Context, characterID int64, refID int64) (*app.CharacterWalletJournalEntry, error)
func (*CharacterService) GetWalletTransactions ¶ added in v0.30.0
func (s *CharacterService) GetWalletTransactions(ctx context.Context, characterID int64, transactionID int64) (*app.CharacterWalletTransaction, error)
func (*CharacterService) HasCharacter ¶ added in v0.26.0
HasCharacter reports whether a character exists.
func (*CharacterService) HasSection ¶ added in v0.57.0
func (s *CharacterService) HasSection(ctx context.Context, characterID int64, section app.CharacterSection) (bool, error)
HasSection reports whether a section has been completed at least once for a character.
func (*CharacterService) HasTokenWithScopes ¶ added in v0.21.0
func (s *CharacterService) HasTokenWithScopes(ctx context.Context, characterID int64, scopes set.Set[string]) (bool, error)
HasTokenWithScopes reports whether a character's token has the requested scopes.
func (*CharacterService) Init ¶ added in v0.76.0
func (s *CharacterService) Init(ctx context.Context) error
Init prepares the service after app start. Must be called before Start.
func (*CharacterService) IsTrainingActive ¶ added in v0.40.0
IsTrainingActive reports whether training is active.
func (*CharacterService) ListAllAssets ¶ added in v0.21.0
func (s *CharacterService) ListAllAssets(ctx context.Context) ([]*app.CharacterAsset, error)
func (*CharacterService) ListAllCharacterContractSlotsCorporation ¶ added in v0.70.0
func (s *CharacterService) ListAllCharacterContractSlotsCorporation(ctx context.Context) ([]app.CharacterContractSlots, error)
func (*CharacterService) ListAllCharacterContractSlotsPersonal ¶ added in v0.70.0
func (s *CharacterService) ListAllCharacterContractSlotsPersonal(ctx context.Context) ([]app.CharacterContractSlots, error)
func (*CharacterService) ListAllCharacterIndustryJob ¶ added in v0.23.0
func (s *CharacterService) ListAllCharacterIndustryJob(ctx context.Context) ([]*app.CharacterIndustryJob, error)
ListAllCharacterIndustryJob returns all industry jobs from characters.
func (*CharacterService) ListAllCharactersIndustrySlots ¶ added in v0.29.0
func (s *CharacterService) ListAllCharactersIndustrySlots(ctx context.Context, typ app.IndustryJobType) ([]app.CharacterIndustrySlots, error)
func (*CharacterService) ListAllContracts ¶ added in v0.23.0
func (s *CharacterService) ListAllContracts(ctx context.Context) ([]*app.CharacterContract, error)
ListAllContracts returns the contracts of all characters. A contract seen by several characters is returned only once: the copy of its issuer or else the copy of the character with the lowest ID.
func (*CharacterService) ListAllImplants ¶ added in v0.40.0
func (s *CharacterService) ListAllImplants(ctx context.Context) ([]*app.CharacterImplant, error)
func (*CharacterService) ListAllJumpClones ¶ added in v0.21.0
func (s *CharacterService) ListAllJumpClones(ctx context.Context) ([]*app.CharacterJumpClone2, error)
func (*CharacterService) ListAllLoyaltyPointEntries ¶ added in v0.60.0
func (s *CharacterService) ListAllLoyaltyPointEntries(ctx context.Context) ([]*app.CharacterLoyaltyPointEntry, error)
func (*CharacterService) ListAllMailHeadersForLabelOrdered ¶ added in v0.75.0
func (s *CharacterService) ListAllMailHeadersForLabelOrdered(ctx context.Context, labelID int64) ([]*app.CharacterMailHeader, error)
ListAllMailHeadersForLabelOrdered returns the mails of all characters for a label in descending order by timestamp.
func (*CharacterService) ListAllMailHeadersForListOrdered ¶ added in v0.75.0
func (s *CharacterService) ListAllMailHeadersForListOrdered(ctx context.Context, listID int64) ([]*app.CharacterMailHeader, error)
ListAllMailHeadersForListOrdered returns the mails of all characters for a mailing list in descending order by timestamp.
func (*CharacterService) ListAllMailLists ¶ added in v0.75.0
ListAllMailLists returns the mailing lists of all characters without duplicates.
func (*CharacterService) ListAllMarketOrder ¶ added in v0.41.0
func (s *CharacterService) ListAllMarketOrder(ctx context.Context, isBuyOrders bool) ([]*app.CharacterMarketOrder, error)
func (*CharacterService) ListAllNotifications ¶ added in v0.69.0
func (s *CharacterService) ListAllNotifications(ctx context.Context) ([]*app.CharacterNotification, error)
func (*CharacterService) ListAllPlanets ¶ added in v0.21.0
func (s *CharacterService) ListAllPlanets(ctx context.Context) ([]*app.CharacterPlanet, error)
func (*CharacterService) ListAllSkills ¶ added in v0.68.0
func (s *CharacterService) ListAllSkills(ctx context.Context) ([]*app.CharacterSkill, error)
ListAllSkills returns the skills from all characters.
func (*CharacterService) ListAssets ¶ added in v0.21.0
func (s *CharacterService) ListAssets(ctx context.Context, characterID int64) ([]*app.CharacterAsset, error)
func (*CharacterService) ListCharacterCorporationIDs ¶ added in v0.44.0
ListCharacterCorporationIDs returns the corporation IDs of the characters.
func (*CharacterService) ListCharacterCorporations ¶ added in v0.40.0
func (s *CharacterService) ListCharacterCorporations(ctx context.Context) ([]*app.EntityShort, error)
ListCharacterCorporations returns the corporations of the characters.
func (*CharacterService) ListCharacterIDs ¶ added in v0.40.0
func (*CharacterService) ListCharacters ¶
func (*CharacterService) ListCharactersForTag ¶ added in v0.30.0
func (s *CharacterService) ListCharactersForTag(ctx context.Context, tagID int64) (tagged []*app.EntityShort, others []*app.EntityShort, err error)
func (*CharacterService) ListCharactersShort ¶
func (s *CharacterService) ListCharactersShort(ctx context.Context) ([]*app.EntityShort, error)
func (*CharacterService) ListContacts ¶ added in v0.63.0
func (s *CharacterService) ListContacts(ctx context.Context, characterID int64) ([]*app.CharacterContact, error)
func (*CharacterService) ListContractItems ¶ added in v0.21.0
func (s *CharacterService) ListContractItems(ctx context.Context, contractID int64) ([]*app.ContractItem, error)
func (*CharacterService) ListEveCharacters ¶ added in v0.70.0
func (s *CharacterService) ListEveCharacters(ctx context.Context) ([]*app.EveCharacter, error)
func (*CharacterService) ListImplants ¶ added in v0.21.0
func (s *CharacterService) ListImplants(ctx context.Context, characterID int64) ([]*app.CharacterImplant, error)
func (*CharacterService) ListJumpClones ¶ added in v0.21.0
func (s *CharacterService) ListJumpClones(ctx context.Context, characterID int64) ([]*app.CharacterJumpClone, error)
func (*CharacterService) ListLoyaltyPointEntries ¶ added in v0.60.0
func (s *CharacterService) ListLoyaltyPointEntries(ctx context.Context, characterID int64) ([]*app.CharacterLoyaltyPointEntry, error)
func (*CharacterService) ListMailHeadersForLabelOrdered ¶ added in v0.21.0
func (s *CharacterService) ListMailHeadersForLabelOrdered(ctx context.Context, characterID int64, labelID int64) ([]*app.CharacterMailHeader, error)
ListMailHeadersForLabelOrdered returns a character's mails for a label in descending order by timestamp.
func (*CharacterService) ListMailHeadersForListOrdered ¶ added in v0.21.0
func (s *CharacterService) ListMailHeadersForListOrdered(ctx context.Context, characterID int64, listID int64) ([]*app.CharacterMailHeader, error)
func (*CharacterService) ListMailLabelsOrdered ¶ added in v0.21.0
func (s *CharacterService) ListMailLabelsOrdered(ctx context.Context, characterID int64) ([]*app.CharacterMailLabel, error)
func (*CharacterService) ListMailLists ¶ added in v0.21.0
func (*CharacterService) ListNotifications ¶ added in v0.69.0
func (s *CharacterService) ListNotifications(ctx context.Context, characterID int64) ([]*app.CharacterNotification, error)
func (*CharacterService) ListPlanets ¶ added in v0.21.0
func (s *CharacterService) ListPlanets(ctx context.Context, characterID int64) ([]*app.CharacterPlanet, error)
func (*CharacterService) ListRoles ¶ added in v0.26.0
func (s *CharacterService) ListRoles(ctx context.Context, characterID int64) ([]app.CharacterRole, error)
func (*CharacterService) ListShipsAbilities ¶ added in v0.21.0
func (s *CharacterService) ListShipsAbilities(ctx context.Context, characterID int64) ([]*app.CharacterShipAbility, error)
func (*CharacterService) ListSkillqueueItems ¶ added in v0.21.0
func (s *CharacterService) ListSkillqueueItems(ctx context.Context, characterID int64) ([]*app.CharacterSkillqueueItem, error)
ListSkillqueueItems returns the list of skillqueue items.
func (*CharacterService) ListSkills ¶ added in v0.61.0
func (s *CharacterService) ListSkills(ctx context.Context, characterID int64) ([]*app.CharacterSkill2, error)
ListSkills returns the skills from a character.
func (*CharacterService) ListTagsByName ¶ added in v0.30.1
func (s *CharacterService) ListTagsByName(ctx context.Context) ([]*app.CharacterTag, error)
func (*CharacterService) ListTagsForCharacter ¶ added in v0.30.0
func (*CharacterService) ListWalletJournalEntries ¶ added in v0.21.0
func (s *CharacterService) ListWalletJournalEntries(ctx context.Context, characterID int64) ([]*app.CharacterWalletJournalEntry, error)
func (*CharacterService) ListWalletTransactions ¶ added in v0.21.0
func (s *CharacterService) ListWalletTransactions(ctx context.Context, characterID int64) ([]*app.CharacterWalletTransaction, error)
func (*CharacterService) MissingScopes ¶ added in v0.36.0
func (*CharacterService) NotifyExpiredTrainingForWatched ¶ added in v0.55.0
func (*CharacterService) NotifyMails ¶
func (*CharacterService) NotifyNotifications ¶ added in v0.69.0
func (*CharacterService) NotifyStoppedColonies ¶ added in v0.76.0
func (s *CharacterService) NotifyStoppedColonies(ctx context.Context, characterID int64, earliest time.Time, notify func(title, content string)) error
NotifyStoppedColonies sends notifications for colonies of a character which stopped working completely. A colony is notified once per snapshot and only when it was active after the snapshot. It will send one notification covering all colonies which stopped working.
func (*CharacterService) NotifyUpdatedContracts ¶
func (*CharacterService) ReadAndReplaceTags ¶ added in v0.56.0
func (s *CharacterService) ReadAndReplaceTags(ctx context.Context, reader io.Reader, version string) error
ReadAndReplaceTags reads a tags definition from reader and replaces the current tags with it.
func (*CharacterService) RemoveTagFromCharacter ¶ added in v0.30.0
func (*CharacterService) SearchESI ¶
func (s *CharacterService) SearchESI(ctx context.Context, search string, categories []app.SearchCategory, strict bool) (map[app.SearchCategory][]*app.EveEntity, int, error)
SearchESI performs a name search for items on the ESI server and returns the results by EveEntity category and sorted by name. It also returns the total number of results. A total of 500 indicates that we exceeded the server limit.
func (*CharacterService) SendDesktopNotification ¶ added in v0.63.0
func (s *CharacterService) SendDesktopNotification(ctx context.Context, n *app.CharacterNotification) error
func (*CharacterService) SendMail ¶ added in v0.21.0
func (s *CharacterService) SendMail(ctx context.Context, characterID int64, subject string, recipients []*app.EveEntity, body string) (int64, error)
SendMail creates a new mail on ESI and stores it locally.
func (*CharacterService) SetMailReadLocal ¶ added in v0.75.0
func (s *CharacterService) SetMailReadLocal(ctx context.Context, characterID, mailID int64, isRead bool) error
SetMailReadLocal updates the read state of a mail in local storage only.
func (*CharacterService) SetNotificationsAsRead ¶ added in v0.69.0
func (*CharacterService) Start ¶ added in v0.76.0
func (s *CharacterService) Start(d time.Duration)
Start starts the update scheduler.
func (*CharacterService) Stop ¶ added in v0.76.0
func (s *CharacterService) Stop()
Stop cancels the update scheduler and background jobs and waits for them.
func (*CharacterService) TokenSource ¶ added in v0.59.0
func (s *CharacterService) TokenSource(ctx context.Context, characterID int64, scopes set.Set[string]) (oauth2.TokenSource, error)
TokenSource returns a valid token source for a character. The token source will automatically refresh when needed.
func (*CharacterService) TokenSourceForCorporation ¶ added in v0.59.0
func (s *CharacterService) TokenSourceForCorporation(ctx context.Context, corporationID int64, roles set.Set[app.Role], scopes set.Set[string]) (oauth2.TokenSource, int64, error)
TokenSourceForCorporation returns a token and character ID of the token's owner from a member character of the corporation. Will match when any of the given roles and scopes. It returns app.ErrNotFound if no such token exists.
func (*CharacterService) TotalTrainingTime ¶ added in v0.29.3
func (s *CharacterService) TotalTrainingTime(ctx context.Context, characterID int64) (optional.Optional[time.Duration], error)
TotalTrainingTime returns the total training time for a character when available. A training time of 0 means that training is not active. An empty training time means that the training status could not be determined.
func (*CharacterService) UpdateAllCalculatedValues ¶ added in v0.65.1
func (s *CharacterService) UpdateAllCalculatedValues(ctx context.Context) error
UpdateAllCalculatedValues updates the calculated values of all characters.
func (*CharacterService) UpdateAllCalculatedValuesAsync ¶ added in v0.76.0
func (s *CharacterService) UpdateAllCalculatedValuesAsync()
UpdateAllCalculatedValuesAsync updates the calculated values of all characters in the background.
func (*CharacterService) UpdateCharacterAndRefreshIfNeededAsync ¶ added in v0.76.0
func (s *CharacterService) UpdateCharacterAndRefreshIfNeededAsync(characterID int64, forceUpdate bool)
UpdateCharacterAndRefreshIfNeededAsync updates all sections of a character if needed in the background.
func (*CharacterService) UpdateCharacterSectionAndRefreshIfNeededAsync ¶ added in v0.76.0
func (s *CharacterService) UpdateCharacterSectionAndRefreshIfNeededAsync(characterID int64, section app.CharacterSection, forceUpdate bool)
UpdateCharacterSectionAndRefreshIfNeededAsync updates a character section if needed in the background.
func (*CharacterService) UpdateCharactersIfNeededAsync ¶ added in v0.76.0
func (s *CharacterService) UpdateCharactersIfNeededAsync(forceUpdate bool)
UpdateCharactersIfNeededAsync updates all characters if needed in the background.
func (*CharacterService) UpdateIsTrainingWatched ¶ added in v0.21.0
func (*CharacterService) UpdateMailBodyESI ¶ added in v0.51.0
func (s *CharacterService) UpdateMailBodyESI(ctx context.Context, characterID int64, mailID int64) (string, error)
UpdateMailBodyESI updates the body of a mail from ESI.
func (*CharacterService) UpdateMailRead ¶
func (s *CharacterService) UpdateMailRead(ctx context.Context, characterID, mailID int64, isRead bool) error
UpdateMailRead updates the read state of a mail on ESI. The local state is expected to be set already with SetMailReadLocal and is reset when the update fails.
func (*CharacterService) UpdateOrCreateCharacterFromSSO ¶
func (s *CharacterService) UpdateOrCreateCharacterFromSSO(ctx context.Context, setInfo func(s string)) (*app.Character, error)
UpdateOrCreateCharacterFromSSO creates or updates a character via SSO authentication. ctx can cancel the login and fetching from ESI. Once storing has started, the call always completes. the setInfo callback is used to update info text in a dialog.
func (*CharacterService) WriteNotificationTypeFixtures ¶ added in v0.72.0
func (s *CharacterService) WriteNotificationTypeFixtures(ctx context.Context, writer io.Writer) error
WriteNotificationTypeFixtures writes the newest notification per distinct type found in storage as JSON, in the evenotification package's testdata shape, with IDs and names anonymized.
type EVENotificationService ¶ added in v0.63.0
type Params ¶ added in v0.24.0
type Params struct {
AuthClient AuthClient
Cache Cache
ConcurrencyLimit int // max number of concurrent Goroutines (per group)
ESIClient *esi.APIClient
EveNotificationService EVENotificationService
EveUniverseService *eveuniverseservice.EVEUniverseService
Settings Settings
Signals *app.Signals
StatusCacheService StatusCache
Storage *storage.Storage
// optional
HTTPClient *http.Client
SendDesktopNotification func(title, content string)
}
type Settings ¶ added in v0.63.0
type Settings interface {
ApprovedContactCost() int
MarketOrderRetentionDays() int
MaxMails() int
MaxWalletTransactions() int
NotificationTypesEnabled() set.Set[string]
NotifyCommunicationsEarliest() time.Time
NotifyCommunicationsEnabled() bool
NotifyContractsEarliest() time.Time
NotifyContractsEnabled() bool
NotifyMailsEarliest() time.Time
NotifyMailsEnabled() bool
NotifyPIEarliest() time.Time
NotifyPIEnabled() bool
NotifyTrainingEnabled() bool
}
type StatusCache ¶ added in v0.63.0
type StatusCache interface {
DeleteCharacter(characterID int64)
DeleteCorporation(corporationID int64)
SetCharacterSection(o *app.CharacterSectionStatus)
UpdateCharacters(ctx context.Context, st statuscache.Storage) error
UpdateCorporations(ctx context.Context, st statuscache.Storage) error
}