Documentation
¶
Overview ¶
Package corporationservice contains the corporation service.
Index ¶
- type Cache
- type CharacterService
- type CorporationService
- func (s *CorporationService) CountContractBids(ctx context.Context, contractID int64) (int, error)
- func (s *CorporationService) GetAnyCorporation(ctx context.Context) (*app.Corporation, error)
- func (s *CorporationService) GetContract(ctx context.Context, corporationID, contractID int32) (*app.CorporationContract, error)
- func (s *CorporationService) GetContractTopBid(ctx context.Context, contractID int64) (*app.CorporationContractBid, error)
- func (s *CorporationService) GetCorporation(ctx context.Context, corporationID int32) (*app.Corporation, error)
- func (s *CorporationService) GetCorporationIndustryJob(ctx context.Context, corporationID, jobID int32) (*app.CorporationIndustryJob, error)
- func (s *CorporationService) GetStructure(ctx context.Context, corporationID int32, structureID int64) (*app.CorporationStructure, error)
- func (s *CorporationService) GetWalletBalance(ctx context.Context, corporationID int32, division app.Division) (float64, error)
- func (s *CorporationService) GetWalletBalancesTotal(ctx context.Context, corporationID int32) (optional.Optional[float64], error)
- func (s *CorporationService) GetWalletJournalEntry(ctx context.Context, corporationID int32, d app.Division, refID int64) (*app.CorporationWalletJournalEntry, error)
- func (s *CorporationService) GetWalletName(ctx context.Context, corporationID int32, division app.Division) (string, error)
- func (s *CorporationService) GetWalletTransaction(ctx context.Context, corporationID int32, d app.Division, transactionID int64) (*app.CorporationWalletTransaction, error)
- func (s *CorporationService) HasCorporation(ctx context.Context, corporationID int32) (bool, error)
- func (s *CorporationService) ListAllCorporationIndustryJobs(ctx context.Context) ([]*app.CorporationIndustryJob, error)
- func (s *CorporationService) ListContractItems(ctx context.Context, contractID int64) ([]*app.CorporationContractItem, error)
- func (s *CorporationService) ListCorporationContracts(ctx context.Context, corporationID int32) ([]*app.CorporationContract, error)
- func (s *CorporationService) ListCorporationIDs(ctx context.Context) (set.Set[int32], error)
- func (s *CorporationService) ListCorporationIndustryJobs(ctx context.Context, corporationID int32) ([]*app.CorporationIndustryJob, error)
- func (s *CorporationService) ListCorporationsShort(ctx context.Context) ([]*app.EntityShort[int32], error)
- func (s *CorporationService) ListMembers(ctx context.Context, corporationID int32) ([]*app.CorporationMember, error)
- func (s *CorporationService) ListPrivilegedCorporations(ctx context.Context) ([]*app.EntityShort[int32], error)
- func (s *CorporationService) ListStructures(ctx context.Context, corporationID int32) ([]*app.CorporationStructure, error)
- func (s *CorporationService) ListWalletBalances(ctx context.Context, corporationID int32) ([]app.CorporationWalletBalanceWithName, error)
- func (s *CorporationService) ListWalletJournalEntries(ctx context.Context, corporationID int32, d app.Division) ([]*app.CorporationWalletJournalEntry, error)
- func (s *CorporationService) ListWalletNames(ctx context.Context, corporationID int32) map[app.Division]string
- func (s *CorporationService) ListWalletTransactions(ctx context.Context, corporationID int32, d app.Division) ([]*app.CorporationWalletTransaction, error)
- func (s *CorporationService) PermittedSection(ctx context.Context, corporationID int32, section app.CorporationSection) (bool, error)
- func (s *CorporationService) PermittedSections(ctx context.Context, corporationID int32) (set.Set[app.CorporationSection], error)
- func (s *CorporationService) RemoveSectionDataWhenPermissionLost(ctx context.Context, corporationID int32) error
- func (s *CorporationService) UpdateCorporations(ctx context.Context) (bool, error)
- func (s *CorporationService) UpdateSectionIfNeeded(ctx context.Context, arg app.CorporationSectionUpdateParams) (bool, error)
- type Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CharacterService ¶
type CorporationService ¶
type CorporationService struct {
// contains filtered or unexported fields
}
CorporationService provides access to all managed Eve Online corporations both online and from local storage.
func New ¶
func New(arg Params) *CorporationService
New creates a new corporation service and returns it. When nil is passed for any parameter a new default instance will be created for it (except for storage).
func (*CorporationService) CountContractBids ¶ added in v0.47.0
func (*CorporationService) GetAnyCorporation ¶ added in v0.35.0
func (s *CorporationService) GetAnyCorporation(ctx context.Context) (*app.Corporation, error)
GetAnyCorporation returns a random corporation from storage. Returns app.ErrNotFound if no corporation is found.
func (*CorporationService) GetContract ¶ added in v0.47.0
func (s *CorporationService) GetContract(ctx context.Context, corporationID, contractID int32) (*app.CorporationContract, error)
GetContract fetches and returns a contract from the database.
func (*CorporationService) GetContractTopBid ¶ added in v0.47.0
func (s *CorporationService) GetContractTopBid(ctx context.Context, contractID int64) (*app.CorporationContractBid, error)
func (*CorporationService) GetCorporation ¶ added in v0.35.0
func (s *CorporationService) GetCorporation(ctx context.Context, corporationID int32) (*app.Corporation, error)
GetCorporation returns a corporation from storage. Returns app.ErrNotFound if the corporation does not exist.
func (*CorporationService) GetCorporationIndustryJob ¶
func (s *CorporationService) GetCorporationIndustryJob(ctx context.Context, corporationID, jobID int32) (*app.CorporationIndustryJob, error)
GetCorporationIndustryJob returns an industry job.
func (*CorporationService) GetStructure ¶ added in v0.43.0
func (s *CorporationService) GetStructure(ctx context.Context, corporationID int32, structureID int64) (*app.CorporationStructure, error)
func (*CorporationService) GetWalletBalance ¶ added in v0.35.0
func (*CorporationService) GetWalletBalancesTotal ¶ added in v0.35.0
func (s *CorporationService) GetWalletBalancesTotal(ctx context.Context, corporationID int32) (optional.Optional[float64], error)
GetWalletBalancesTotal returns the sum of all wallet balances. It returns empty if there was no data.
func (*CorporationService) GetWalletJournalEntry ¶ added in v0.35.0
func (s *CorporationService) GetWalletJournalEntry(ctx context.Context, corporationID int32, d app.Division, refID int64) (*app.CorporationWalletJournalEntry, error)
func (*CorporationService) GetWalletName ¶ added in v0.35.0
func (*CorporationService) GetWalletTransaction ¶ added in v0.35.0
func (s *CorporationService) GetWalletTransaction(ctx context.Context, corporationID int32, d app.Division, transactionID int64) (*app.CorporationWalletTransaction, error)
func (*CorporationService) HasCorporation ¶ added in v0.35.0
HasCorporation reports whether we have access to a corporation via an owned character.
func (*CorporationService) ListAllCorporationIndustryJobs ¶
func (s *CorporationService) ListAllCorporationIndustryJobs(ctx context.Context) ([]*app.CorporationIndustryJob, error)
ListAllCorporationIndustryJobs returns all industry jobs from all corporations.
func (*CorporationService) ListContractItems ¶ added in v0.47.0
func (s *CorporationService) ListContractItems(ctx context.Context, contractID int64) ([]*app.CorporationContractItem, error)
func (*CorporationService) ListCorporationContracts ¶ added in v0.47.0
func (s *CorporationService) ListCorporationContracts(ctx context.Context, corporationID int32) ([]*app.CorporationContract, error)
func (*CorporationService) ListCorporationIDs ¶
ListCorporationIDs returns all corporation IDs.
func (*CorporationService) ListCorporationIndustryJobs ¶ added in v0.42.0
func (s *CorporationService) ListCorporationIndustryJobs(ctx context.Context, corporationID int32) ([]*app.CorporationIndustryJob, error)
ListCorporationIndustryJobs returns all industry jobs from a corporation.
func (*CorporationService) ListCorporationsShort ¶ added in v0.40.0
func (s *CorporationService) ListCorporationsShort(ctx context.Context) ([]*app.EntityShort[int32], error)
ListCorporationsShort returns all corporations in short form.
func (*CorporationService) ListMembers ¶ added in v0.35.0
func (s *CorporationService) ListMembers(ctx context.Context, corporationID int32) ([]*app.CorporationMember, error)
func (*CorporationService) ListPrivilegedCorporations ¶ added in v0.40.0
func (s *CorporationService) ListPrivilegedCorporations(ctx context.Context) ([]*app.EntityShort[int32], error)
ListPrivilegedCorporations returns all corporations with privileged access.
func (*CorporationService) ListStructures ¶ added in v0.43.0
func (s *CorporationService) ListStructures(ctx context.Context, corporationID int32) ([]*app.CorporationStructure, error)
func (*CorporationService) ListWalletBalances ¶ added in v0.35.0
func (s *CorporationService) ListWalletBalances(ctx context.Context, corporationID int32) ([]app.CorporationWalletBalanceWithName, error)
ListWalletBalances returns the wallet balances for all divisions.
func (*CorporationService) ListWalletJournalEntries ¶ added in v0.35.0
func (s *CorporationService) ListWalletJournalEntries(ctx context.Context, corporationID int32, d app.Division) ([]*app.CorporationWalletJournalEntry, error)
func (*CorporationService) ListWalletNames ¶ added in v0.35.0
func (*CorporationService) ListWalletTransactions ¶ added in v0.35.0
func (s *CorporationService) ListWalletTransactions(ctx context.Context, corporationID int32, d app.Division) ([]*app.CorporationWalletTransaction, error)
func (*CorporationService) PermittedSection ¶ added in v0.35.0
func (s *CorporationService) PermittedSection(ctx context.Context, corporationID int32, section app.CorporationSection) (bool, error)
PermittedSection reports whether the user has permission to access a section.
func (*CorporationService) PermittedSections ¶ added in v0.35.0
func (s *CorporationService) PermittedSections(ctx context.Context, corporationID int32) (set.Set[app.CorporationSection], error)
PermittedSections returns which sections the user has permission to access. i.e. the user has a character with the required roles and scopes.
func (*CorporationService) RemoveSectionDataWhenPermissionLost ¶ added in v0.35.0
func (s *CorporationService) RemoveSectionDataWhenPermissionLost(ctx context.Context, corporationID int32) error
RemoveSectionDataWhenPermissionLost removes all data related to a corporation section after the permission was lost. This can happen after a character has lost a role or a character was deleted.
func (*CorporationService) UpdateCorporations ¶ added in v0.44.0
func (s *CorporationService) UpdateCorporations(ctx context.Context) (bool, error)
UpdateCorporations removes all corporations which no longer have a user's character as member and creates missing corporations. It reports whether any corporation was removed or added.
func (*CorporationService) UpdateSectionIfNeeded ¶
func (s *CorporationService) UpdateSectionIfNeeded(ctx context.Context, arg app.CorporationSectionUpdateParams) (bool, error)
UpdateSectionIfNeeded updates a section from ESI if has expired and changed and reports back if it has changed
type Params ¶
type Params struct {
Cache Cache
CharacterService CharacterService
ConcurrencyLimit int // max number of concurrent Goroutines (per group)
EveUniverseService *eveuniverseservice.EveUniverseService
StatusCacheService *statuscacheservice.StatusCacheService
Storage *storage.Storage
// optional
HTTPClient *http.Client
EsiClient *goesi.APIClient
}