character

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

package goesi contains helpers used in conjunction with the goesi package

Package character contains the character service.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAborted  = errors.New("process aborted prematurely")
	ErrNotFound = errors.New("object not found")
)

Functions

This section is empty.

Types

type CharacterService

type CharacterService struct {
	EveNotificationService *evenotification.EveNotificationService
	EveUniverseService     *eveuniverse.EveUniverseService
	StatusCacheService     app.StatusCacheService
	SSOService             *sso.SSOService
	// contains filtered or unexported fields
}

CharacterService provides access to all managed Eve Online characters both online and from local storage.

func New

func New(
	st *storage.Storage,
	httpClient *http.Client,
	esiClient *goesi.APIClient,

) *CharacterService

New creates a new Characters 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) AddEveEntitiesFromCharacterSearchESI

func (s *CharacterService) AddEveEntitiesFromCharacterSearchESI(ctx context.Context, characterID int32, search string) ([]int32, error)

AddEveEntitiesFromCharacterSearchESI 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) CalcCharacterNotificationUnreadCounts

func (s *CharacterService) CalcCharacterNotificationUnreadCounts(ctx context.Context, characterID int32) (map[evenotification.Category]int, error)

func (*CharacterService) CharacterAssetTotalValue

func (s *CharacterService) CharacterAssetTotalValue(ctx context.Context, characterID int32) (optional.Optional[float64], error)

func (*CharacterService) CharacterHasTokenWithScopes

func (s *CharacterService) CharacterHasTokenWithScopes(ctx context.Context, characterID int32) (bool, error)

CharacterHasTokenWithScopes reports wether a token with the requested scopes exists for a character.

func (*CharacterService) DeleteCharacter

func (s *CharacterService) DeleteCharacter(ctx context.Context, characterID int32) error

func (*CharacterService) DeleteCharacterMail

func (s *CharacterService) DeleteCharacterMail(ctx context.Context, characterID, mailID int32) error

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

func (*CharacterService) GetAnyCharacter

func (s *CharacterService) GetAnyCharacter(ctx context.Context) (*app.Character, error)

func (*CharacterService) GetCharacter

func (s *CharacterService) GetCharacter(ctx context.Context, characterID int32) (*app.Character, error)

func (*CharacterService) GetCharacterAttributes

func (s *CharacterService) GetCharacterAttributes(ctx context.Context, characterID int32) (*app.CharacterAttributes, error)

func (*CharacterService) GetCharacterMail

func (s *CharacterService) GetCharacterMail(ctx context.Context, characterID int32, mailID int32) (*app.CharacterMail, error)

func (*CharacterService) GetCharacterMailCounts

func (s *CharacterService) GetCharacterMailCounts(ctx context.Context, characterID int32) (int, int, error)

GetMailUnreadCount returns the number of unread mail for a character.

func (*CharacterService) GetCharacterMailLabelUnreadCounts

func (s *CharacterService) GetCharacterMailLabelUnreadCounts(ctx context.Context, characterID int32) (map[int32]int, error)

func (*CharacterService) GetCharacterMailListUnreadCounts

func (s *CharacterService) GetCharacterMailListUnreadCounts(ctx context.Context, characterID int32) (map[int32]int, error)

func (*CharacterService) GetCharacterSkill

func (s *CharacterService) GetCharacterSkill(ctx context.Context, characterID, typeID int32) (*app.CharacterSkill, error)

func (*CharacterService) GetCharacterTotalTrainingTime

func (s *CharacterService) GetCharacterTotalTrainingTime(ctx context.Context, characterID int32) (optional.Optional[time.Duration], error)

func (*CharacterService) ListAllCharacterAssets

func (s *CharacterService) ListAllCharacterAssets(ctx context.Context) ([]*app.CharacterAsset, error)

func (*CharacterService) ListCharacterAssets

func (s *CharacterService) ListCharacterAssets(ctx context.Context, characterID int32) ([]*app.CharacterAsset, error)

func (*CharacterService) ListCharacterAssetsInItemHangar

func (s *CharacterService) ListCharacterAssetsInItemHangar(ctx context.Context, characterID int32, locationID int64) ([]*app.CharacterAsset, error)

func (*CharacterService) ListCharacterAssetsInLocation

func (s *CharacterService) ListCharacterAssetsInLocation(ctx context.Context, characterID int32, locationID int64) ([]*app.CharacterAsset, error)

func (*CharacterService) ListCharacterAssetsInShipHangar

func (s *CharacterService) ListCharacterAssetsInShipHangar(ctx context.Context, characterID int32, locationID int64) ([]*app.CharacterAsset, error)

func (*CharacterService) ListCharacterImplants

func (s *CharacterService) ListCharacterImplants(ctx context.Context, characterID int32) ([]*app.CharacterImplant, error)

func (*CharacterService) ListCharacterJumpClones

func (s *CharacterService) ListCharacterJumpClones(ctx context.Context, characterID int32) ([]*app.CharacterJumpClone, error)

func (*CharacterService) ListCharacterMailHeadersForLabelOrdered

func (s *CharacterService) ListCharacterMailHeadersForLabelOrdered(ctx context.Context, characterID int32, labelID int32) ([]*app.CharacterMailHeader, error)

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

func (*CharacterService) ListCharacterMailHeadersForListOrdered

func (s *CharacterService) ListCharacterMailHeadersForListOrdered(ctx context.Context, characterID int32, listID int32) ([]*app.CharacterMailHeader, error)

func (*CharacterService) ListCharacterMailHeadersForUnprocessed

func (s *CharacterService) ListCharacterMailHeadersForUnprocessed(ctx context.Context, characterID int32) ([]*app.CharacterMailHeader, error)

ListCharacterMailHeadersForUnprocessed returns all unprocessed mails for a character except sent mails ordered by timestamp.

func (*CharacterService) ListCharacterMailLabelsOrdered

func (s *CharacterService) ListCharacterMailLabelsOrdered(ctx context.Context, characterID int32) ([]*app.CharacterMailLabel, error)

func (*CharacterService) ListCharacterMailLists

func (s *CharacterService) ListCharacterMailLists(ctx context.Context, characterID int32) ([]*app.EveEntity, error)

func (*CharacterService) ListCharacterNotificationsTypes

func (s *CharacterService) ListCharacterNotificationsTypes(ctx context.Context, characterID int32, types []evenotification.Type) ([]*app.CharacterNotification, error)

func (*CharacterService) ListCharacterNotificationsUnprocessed

func (s *CharacterService) ListCharacterNotificationsUnprocessed(ctx context.Context, characterID int32) ([]*app.CharacterNotification, error)

ListCharacterNotificationsUnprocessed returns all unprocessed notifications for a given character, which are not older then 24 hours and which have rendered title and body.

func (*CharacterService) ListCharacterNotificationsUnread

func (s *CharacterService) ListCharacterNotificationsUnread(ctx context.Context, characterID int32) ([]*app.CharacterNotification, error)

func (*CharacterService) ListCharacterShipSkills

func (s *CharacterService) ListCharacterShipSkills(ctx context.Context, characterID, shipTypeID int32) ([]*app.CharacterShipSkill, error)

func (*CharacterService) ListCharacterShipsAbilities

func (s *CharacterService) ListCharacterShipsAbilities(ctx context.Context, characterID int32, search string) ([]*app.CharacterShipAbility, error)

func (*CharacterService) ListCharacterSkillGroupsProgress

func (s *CharacterService) ListCharacterSkillGroupsProgress(ctx context.Context, characterID int32) ([]app.ListCharacterSkillGroupProgress, error)

func (*CharacterService) ListCharacterSkillProgress

func (s *CharacterService) ListCharacterSkillProgress(ctx context.Context, characterID, eveGroupID int32) ([]app.ListCharacterSkillProgress, error)

func (*CharacterService) ListCharacterSkillqueueItems

func (s *CharacterService) ListCharacterSkillqueueItems(ctx context.Context, characterID int32) ([]*app.CharacterSkillqueueItem, error)

func (*CharacterService) ListCharacterWalletJournalEntries

func (s *CharacterService) ListCharacterWalletJournalEntries(ctx context.Context, characterID int32) ([]*app.CharacterWalletJournalEntry, error)

func (*CharacterService) ListCharacterWalletTransactions

func (s *CharacterService) ListCharacterWalletTransactions(ctx context.Context, characterID int32) ([]*app.CharacterWalletTransaction, error)

func (*CharacterService) ListCharacters

func (s *CharacterService) ListCharacters(ctx context.Context) ([]*app.Character, error)

func (*CharacterService) ListCharactersShort

func (s *CharacterService) ListCharactersShort(ctx context.Context) ([]*app.CharacterShort, error)

func (*CharacterService) SectionWasUpdated

func (s *CharacterService) SectionWasUpdated(ctx context.Context, characterID int32, section app.CharacterSection) (bool, error)

SectionWasUpdated reports wether the section has been updated at all.

func (*CharacterService) SendCharacterMail

func (s *CharacterService) SendCharacterMail(ctx context.Context, characterID int32, subject string, recipients []*app.EveEntity, body string) (int32, error)

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

func (*CharacterService) UpdateCharacterAssetTotalValue

func (s *CharacterService) UpdateCharacterAssetTotalValue(ctx context.Context, characterID int32) (float64, error)

func (*CharacterService) UpdateCharacterMailSetProcessed

func (s *CharacterService) UpdateCharacterMailSetProcessed(ctx context.Context, id int64) error

func (*CharacterService) UpdateCharacterNotificationSetProcessed

func (s *CharacterService) UpdateCharacterNotificationSetProcessed(ctx context.Context, n *app.CharacterNotification) error

func (*CharacterService) UpdateCharacterSkillqueueESI

func (s *CharacterService) UpdateCharacterSkillqueueESI(ctx context.Context, arg UpdateSectionParams) (bool, error)

UpdateCharacterSkillqueueESI updates the skillqueue for a character from ESI and reports wether it has changed.

func (*CharacterService) UpdateMailRead

func (s *CharacterService) UpdateMailRead(ctx context.Context, characterID, mailID int32) error

UpdateMailRead updates an existing mail as read

func (*CharacterService) UpdateOrCreateCharacterFromSSO

func (s *CharacterService) UpdateOrCreateCharacterFromSSO(ctx context.Context, infoText binding.ExternalString) (int32, error)

UpdateOrCreateCharacterFromSSO creates or updates a character via SSO authentication.

func (*CharacterService) UpdateSectionIfNeeded

func (s *CharacterService) UpdateSectionIfNeeded(ctx context.Context, arg UpdateSectionParams) (bool, error)

UpdateSectionIfNeeded updates a section from ESI if has expired and changed and reports back if it has changed

type UpdateSectionParams

type UpdateSectionParams struct {
	CharacterID           int32
	Section               app.CharacterSection
	ForceUpdate           bool
	MaxMails              int
	MaxWalletTransactions int
}

Jump to

Keyboard shortcuts

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