Documentation
¶
Overview ¶
Package eveuniverseservice contains EVE universe service.
Index ¶
- type EveUniverseService
- func (s *EveUniverseService) AddMissingEntities(ctx context.Context, ids set.Set[int32]) (set.Set[int32], error)
- func (s *EveUniverseService) AddMissingEveEntitiesAndLocations(ctx context.Context, entityIDs set.Set[int32], locationIDs set.Set[int64]) error
- func (s *EveUniverseService) AddMissingLocations(ctx context.Context, ids set.Set[int64]) error
- func (s *EveUniverseService) AddMissingRegions(ctx context.Context, ids set.Set[int32]) error
- func (s *EveUniverseService) AddMissingSolarSystems(ctx context.Context, ids set.Set[int32]) error
- func (s *EveUniverseService) AddMissingTypes(ctx context.Context, ids set.Set[int32]) error
- func (s *EveUniverseService) EntityIDsFromLocationsESI(ctx context.Context, ids []int64) (set.Set[int32], error)
- func (s *EveUniverseService) FetchAlliance(ctx context.Context, allianceID int32) (*app.EveAlliance, error)
- func (s *EveUniverseService) FetchAllianceCorporations(ctx context.Context, allianceID int32) ([]*app.EveEntity, error)
- func (s *EveUniverseService) FetchCharacterCorporationHistory(ctx context.Context, characterID int32) ([]app.MembershipHistoryItem, error)
- func (s *EveUniverseService) FetchCorporationAllianceHistory(ctx context.Context, corporationID int32) ([]app.MembershipHistoryItem, error)
- func (s *EveUniverseService) FetchRoute(ctx context.Context, args app.EveRouteHeader) ([]*app.EveSolarSystem, error)
- func (s *EveUniverseService) FetchRoutes(ctx context.Context, headers []app.EveRouteHeader) (map[app.EveRouteHeader][]*app.EveSolarSystem, error)
- func (s *EveUniverseService) FormatDogmaValue(ctx context.Context, value float32, unitID app.EveUnitID) (string, int32)
- func (s *EveUniverseService) GetCharacterESI(ctx context.Context, characterID int32) (*app.EveCharacter, error)
- func (s *EveUniverseService) GetConstellationSolarSystemsESI(ctx context.Context, id int32) ([]*app.EveSolarSystem, error)
- func (s *EveUniverseService) GetCorporation(ctx context.Context, corporationID int32) (*app.EveCorporation, error)
- func (s *EveUniverseService) GetDogmaAttribute(ctx context.Context, id int32) (*app.EveDogmaAttribute, error)
- func (s *EveUniverseService) GetEntity(ctx context.Context, id int32) (*app.EveEntity, error)
- func (s *EveUniverseService) GetLocation(ctx context.Context, id int64) (*app.EveLocation, error)
- func (s *EveUniverseService) GetOrCreateCategoryESI(ctx context.Context, id int32) (*app.EveCategory, error)
- func (s *EveUniverseService) GetOrCreateCharacterESI(ctx context.Context, characterID int32) (*app.EveCharacter, bool, error)
- func (s *EveUniverseService) GetOrCreateConstellationESI(ctx context.Context, id int32) (*app.EveConstellation, error)
- func (s *EveUniverseService) GetOrCreateCorporationESI(ctx context.Context, id int32) (*app.EveCorporation, error)
- func (s *EveUniverseService) GetOrCreateDogmaAttributeESI(ctx context.Context, id int32) (*app.EveDogmaAttribute, error)
- func (s *EveUniverseService) GetOrCreateEntityESI(ctx context.Context, id int32) (*app.EveEntity, error)
- func (s *EveUniverseService) GetOrCreateGroupESI(ctx context.Context, id int32) (*app.EveGroup, error)
- func (s *EveUniverseService) GetOrCreateLocationESI(ctx context.Context, id int64) (*app.EveLocation, error)
- func (s *EveUniverseService) GetOrCreateMoonESI(ctx context.Context, id int32) (*app.EveMoon, error)
- func (s *EveUniverseService) GetOrCreatePlanetESI(ctx context.Context, id int32) (*app.EvePlanet, error)
- func (s *EveUniverseService) GetOrCreateRaceESI(ctx context.Context, id int32) (*app.EveRace, error)
- func (s *EveUniverseService) GetOrCreateRegionESI(ctx context.Context, id int32) (*app.EveRegion, error)
- func (s *EveUniverseService) GetOrCreateSchematicESI(ctx context.Context, id int32) (*app.EveSchematic, error)
- func (s *EveUniverseService) GetOrCreateSolarSystemESI(ctx context.Context, id int32) (*app.EveSolarSystem, error)
- func (s *EveUniverseService) GetOrCreateTypeESI(ctx context.Context, id int32) (*app.EveType, error)
- func (s *EveUniverseService) GetRegionConstellationsESI(ctx context.Context, id int32) ([]*app.EveEntity, error)
- func (s *EveUniverseService) GetSolarSystemInfoESI(ctx context.Context, solarSystemID int32) (starID int32, planets []app.EveSolarSystemPlanet, stargateIDs []int32, ...)
- func (s *EveUniverseService) GetSolarSystemPlanets(ctx context.Context, planets []app.EveSolarSystemPlanet) ([]*app.EvePlanet, error)
- func (s *EveUniverseService) GetStarTypeID(ctx context.Context, id int32) (int32, error)
- func (s *EveUniverseService) GetStargatesSolarSystemsESI(ctx context.Context, stargateIDs []int32) ([]*app.EveSolarSystem, error)
- func (s *EveUniverseService) GetStationServicesESI(ctx context.Context, id int32) ([]string, error)
- func (s *EveUniverseService) GetType(ctx context.Context, id int32) (*app.EveType, error)
- func (s *EveUniverseService) ListEntitiesByPartialName(ctx context.Context, partial string) ([]*app.EveEntity, error)
- func (s *EveUniverseService) ListEntitiesForIDs(ctx context.Context, ids []int32) ([]*app.EveEntity, error)
- func (s *EveUniverseService) ListEveTypeIDs(ctx context.Context) (set.Set[int32], error)
- func (s *EveUniverseService) ListLocations(ctx context.Context) ([]*app.EveLocation, error)
- func (s *EveUniverseService) ListTypeDogmaAttributesForType(ctx context.Context, typeID int32) ([]*app.EveTypeDogmaAttribute, error)
- func (s *EveUniverseService) MarketPrice(ctx context.Context, typeID int32) (optional.Optional[float64], error)
- func (s *EveUniverseService) RandomizeAllAllianceNames(ctx context.Context) error
- func (s *EveUniverseService) RandomizeAllCharacterNames(ctx context.Context) error
- func (s *EveUniverseService) RandomizeAllCorporationNames(ctx context.Context) error
- func (s *EveUniverseService) ToEntities(ctx context.Context, ids set.Set[int32]) (map[int32]*app.EveEntity, error)
- func (s *EveUniverseService) UpdateAllCharactersESI(ctx context.Context) (set.Set[int32], error)
- func (s *EveUniverseService) UpdateAllCorporationsESI(ctx context.Context) (set.Set[int32], error)
- func (s *EveUniverseService) UpdateAllEntitiesESI(ctx context.Context) (set.Set[int32], error)
- func (s *EveUniverseService) UpdateCategoryWithChildrenESI(ctx context.Context, categoryID int32) error
- func (s *EveUniverseService) UpdateOrCreateCharacterESI(ctx context.Context, characterID int32) (*app.EveCharacter, bool, error)
- func (s *EveUniverseService) UpdateOrCreateCorporationFromESI(ctx context.Context, id int32) (*app.EveCorporation, error)
- func (s *EveUniverseService) UpdateOrCreateLocationESI(ctx context.Context, id int64) (*app.EveLocation, error)
- func (s *EveUniverseService) UpdateSectionIfNeeded(ctx context.Context, arg app.GeneralSectionUpdateParams) (set.Set[int32], error)
- func (s *EveUniverseService) UpdateShipSkills(ctx context.Context) error
- type Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EveUniverseService ¶
type EveUniverseService struct {
// Now returns the current time in UTC. Can be overwritten for tests.
Now func() time.Time
// contains filtered or unexported fields
}
EveUniverseService provides access to Eve Online models with on-demand loading from ESI and persistent local caching.
func New ¶
func New(arg Params) *EveUniverseService
New returns a new instance of an Eve universe service.
func (*EveUniverseService) AddMissingEntities ¶
func (s *EveUniverseService) AddMissingEntities(ctx context.Context, ids set.Set[int32]) (set.Set[int32], error)
AddMissingEntities adds EveEntities from ESI for IDs missing in the database and returns which IDs where indeed missing.
ID 0 will be ignored
func (*EveUniverseService) AddMissingEveEntitiesAndLocations ¶ added in v0.47.0
func (*EveUniverseService) AddMissingLocations ¶ added in v0.27.0
AddMissingLocations adds missing EveLocations from ESI. Invalid IDs (e.g. ID 0) will be ignored.
func (*EveUniverseService) AddMissingRegions ¶ added in v0.41.0
AddMissingRegions fetches missing regions from ESI. Invalid IDs (e.g. 0) will be ignored
func (*EveUniverseService) AddMissingSolarSystems ¶ added in v0.43.0
AddMissingSolarSystems fetches missing solar systems from ESI. Invalid IDs (e.g. 0) will be ignored
func (*EveUniverseService) AddMissingTypes ¶ added in v0.20.0
AddMissingTypes fetches missing typeIDs from ESI. Invalid IDs (e.g. 0) will be ignored
func (*EveUniverseService) EntityIDsFromLocationsESI ¶ added in v0.27.0
func (s *EveUniverseService) EntityIDsFromLocationsESI(ctx context.Context, ids []int64) (set.Set[int32], error)
EntityIDsFromLocationsESI returns the EveEntity IDs in EveLocation ids from ESI. This methods allows bulk resolving EveEntities before fetching many new locations from ESI.
func (*EveUniverseService) FetchAlliance ¶ added in v0.25.2
func (s *EveUniverseService) FetchAlliance(ctx context.Context, allianceID int32) (*app.EveAlliance, error)
FetchAlliance fetches an alliance from ESI and returns it.
func (*EveUniverseService) FetchAllianceCorporations ¶ added in v0.25.2
func (s *EveUniverseService) FetchAllianceCorporations(ctx context.Context, allianceID int32) ([]*app.EveEntity, error)
FetchAllianceCorporations fetches the corporations for an alliance from ESI and returns them.
func (*EveUniverseService) FetchCharacterCorporationHistory ¶ added in v0.25.1
func (s *EveUniverseService) FetchCharacterCorporationHistory(ctx context.Context, characterID int32) ([]app.MembershipHistoryItem, error)
FetchCharacterCorporationHistory returns a list of all the corporations a character has been a member of in descending order.
func (*EveUniverseService) FetchCorporationAllianceHistory ¶ added in v0.25.1
func (s *EveUniverseService) FetchCorporationAllianceHistory(ctx context.Context, corporationID int32) ([]app.MembershipHistoryItem, error)
FetchCorporationAllianceHistory returns a list of all the alliances a corporation has been a member of in descending order.
func (*EveUniverseService) FetchRoute ¶ added in v0.25.1
func (s *EveUniverseService) FetchRoute(ctx context.Context, args app.EveRouteHeader) ([]*app.EveSolarSystem, error)
FetchRoute fetches a route between two solar systems from ESi and returns it. When no route can be found it returns an empty slice.
func (*EveUniverseService) FetchRoutes ¶ added in v0.28.0
func (s *EveUniverseService) FetchRoutes(ctx context.Context, headers []app.EveRouteHeader) (map[app.EveRouteHeader][]*app.EveSolarSystem, error)
FetchRoutes returns routes for one or multiple headers.
func (*EveUniverseService) FormatDogmaValue ¶
func (s *EveUniverseService) FormatDogmaValue(ctx context.Context, value float32, unitID app.EveUnitID) (string, int32)
FormatDogmaValue returns a formatted value.
func (*EveUniverseService) GetCharacterESI ¶
func (s *EveUniverseService) GetCharacterESI(ctx context.Context, characterID int32) (*app.EveCharacter, error)
func (*EveUniverseService) GetConstellationSolarSystemsESI ¶ added in v0.25.2
func (s *EveUniverseService) GetConstellationSolarSystemsESI(ctx context.Context, id int32) ([]*app.EveSolarSystem, error)
GetConstellationSolarSystemsESI fetches and returns the solar systems for a constellations from ESI.
func (*EveUniverseService) GetCorporation ¶ added in v0.41.0
func (s *EveUniverseService) GetCorporation(ctx context.Context, corporationID int32) (*app.EveCorporation, error)
func (*EveUniverseService) GetDogmaAttribute ¶ added in v0.20.0
func (s *EveUniverseService) GetDogmaAttribute(ctx context.Context, id int32) (*app.EveDogmaAttribute, error)
func (*EveUniverseService) GetLocation ¶
func (s *EveUniverseService) GetLocation(ctx context.Context, id int64) (*app.EveLocation, error)
func (*EveUniverseService) GetOrCreateCategoryESI ¶ added in v0.20.0
func (s *EveUniverseService) GetOrCreateCategoryESI(ctx context.Context, id int32) (*app.EveCategory, error)
func (*EveUniverseService) GetOrCreateCharacterESI ¶
func (s *EveUniverseService) GetOrCreateCharacterESI(ctx context.Context, characterID int32) (*app.EveCharacter, bool, error)
func (*EveUniverseService) GetOrCreateConstellationESI ¶
func (s *EveUniverseService) GetOrCreateConstellationESI(ctx context.Context, id int32) (*app.EveConstellation, error)
func (*EveUniverseService) GetOrCreateCorporationESI ¶ added in v0.27.0
func (s *EveUniverseService) GetOrCreateCorporationESI(ctx context.Context, id int32) (*app.EveCorporation, error)
func (*EveUniverseService) GetOrCreateDogmaAttributeESI ¶ added in v0.20.0
func (s *EveUniverseService) GetOrCreateDogmaAttributeESI(ctx context.Context, id int32) (*app.EveDogmaAttribute, error)
func (*EveUniverseService) GetOrCreateEntityESI ¶
func (*EveUniverseService) GetOrCreateGroupESI ¶ added in v0.20.0
func (*EveUniverseService) GetOrCreateLocationESI ¶
func (s *EveUniverseService) GetOrCreateLocationESI(ctx context.Context, id int64) (*app.EveLocation, error)
GetOrCreateLocationESI return a location. When the location does not yet exist in storage it tries to fetch and create a new location from ESI.
Important: For creating structures a valid token with the structure scope must be set in the context or an error will be returned
func (*EveUniverseService) GetOrCreateMoonESI ¶ added in v0.20.0
func (*EveUniverseService) GetOrCreatePlanetESI ¶
func (*EveUniverseService) GetOrCreateRaceESI ¶ added in v0.20.0
func (*EveUniverseService) GetOrCreateRegionESI ¶
func (*EveUniverseService) GetOrCreateSchematicESI ¶
func (s *EveUniverseService) GetOrCreateSchematicESI(ctx context.Context, id int32) (*app.EveSchematic, error)
func (*EveUniverseService) GetOrCreateSolarSystemESI ¶
func (s *EveUniverseService) GetOrCreateSolarSystemESI(ctx context.Context, id int32) (*app.EveSolarSystem, error)
func (*EveUniverseService) GetOrCreateTypeESI ¶
func (*EveUniverseService) GetRegionConstellationsESI ¶
func (s *EveUniverseService) GetRegionConstellationsESI(ctx context.Context, id int32) ([]*app.EveEntity, error)
GetRegionConstellationsESI fetches and returns the constellations for a region.
func (*EveUniverseService) GetSolarSystemInfoESI ¶
func (s *EveUniverseService) GetSolarSystemInfoESI(ctx context.Context, solarSystemID int32) (starID int32, planets []app.EveSolarSystemPlanet, stargateIDs []int32, stations []*app.EveEntity, structures []*app.EveLocation, err error)
GetSolarSystemInfoESI fetches and returns details about a solar system from ESI.
func (*EveUniverseService) GetSolarSystemPlanets ¶ added in v0.19.0
func (s *EveUniverseService) GetSolarSystemPlanets(ctx context.Context, planets []app.EveSolarSystemPlanet) ([]*app.EvePlanet, error)
GetSolarSystemPlanets fetches and returns the planets for a solar system from ESI.
func (*EveUniverseService) GetStarTypeID ¶
func (*EveUniverseService) GetStargatesSolarSystemsESI ¶ added in v0.29.2
func (s *EveUniverseService) GetStargatesSolarSystemsESI(ctx context.Context, stargateIDs []int32) ([]*app.EveSolarSystem, error)
GetStargatesSolarSystemsESI fetches and returns the solar systems which relates to given stargates from ESI.
func (*EveUniverseService) GetStationServicesESI ¶ added in v0.19.0
GetStationServicesESI fetches and returns the services of a station from ESI.
func (*EveUniverseService) ListEntitiesByPartialName ¶
func (*EveUniverseService) ListEntitiesForIDs ¶ added in v0.20.0
func (*EveUniverseService) ListEveTypeIDs ¶ added in v0.40.0
func (*EveUniverseService) ListLocations ¶
func (s *EveUniverseService) ListLocations(ctx context.Context) ([]*app.EveLocation, error)
func (*EveUniverseService) ListTypeDogmaAttributesForType ¶
func (s *EveUniverseService) ListTypeDogmaAttributesForType( ctx context.Context, typeID int32, ) ([]*app.EveTypeDogmaAttribute, error)
func (*EveUniverseService) MarketPrice ¶ added in v0.25.1
func (s *EveUniverseService) MarketPrice(ctx context.Context, typeID int32) (optional.Optional[float64], error)
MarketPrice returns the average market price for a type. Or empty when no price is known for this type.
func (*EveUniverseService) RandomizeAllAllianceNames ¶ added in v0.32.0
func (s *EveUniverseService) RandomizeAllAllianceNames(ctx context.Context) error
RandomizeAllAllianceNames randomizes the names of all alliances.
func (*EveUniverseService) RandomizeAllCharacterNames ¶ added in v0.32.0
func (s *EveUniverseService) RandomizeAllCharacterNames(ctx context.Context) error
RandomizeAllCharacterNames randomizes the names of all characters.
func (*EveUniverseService) RandomizeAllCorporationNames ¶ added in v0.32.0
func (s *EveUniverseService) RandomizeAllCorporationNames(ctx context.Context) error
RandomizeAllCorporationNames randomizes the names of all characters.
func (*EveUniverseService) ToEntities ¶ added in v0.20.0
func (s *EveUniverseService) ToEntities(ctx context.Context, ids set.Set[int32]) (map[int32]*app.EveEntity, error)
ToEntities returns the resolved EveEntities for a list of valid entity IDs. It guarantees a result for every ID and will map unknown IDs (including 0 & 1) to empty EveEntity objects.
func (*EveUniverseService) UpdateAllCharactersESI ¶ added in v0.20.0
UpdateAllCharactersESI updates all known Eve characters from ESI and returns the IDs of all changed characters.
func (*EveUniverseService) UpdateAllCorporationsESI ¶ added in v0.27.0
UpdateAllCorporationsESI updates all known corporations from ESI.
func (*EveUniverseService) UpdateAllEntitiesESI ¶ added in v0.32.0
func (*EveUniverseService) UpdateCategoryWithChildrenESI ¶ added in v0.20.0
func (s *EveUniverseService) UpdateCategoryWithChildrenESI(ctx context.Context, categoryID int32) error
func (*EveUniverseService) UpdateOrCreateCharacterESI ¶ added in v0.42.1
func (s *EveUniverseService) UpdateOrCreateCharacterESI(ctx context.Context, characterID int32) (*app.EveCharacter, bool, error)
UpdateOrCreateCharacterESI updates or create a character from ESI. Returns app.ErrNotFound when the character does not exist.
func (*EveUniverseService) UpdateOrCreateCorporationFromESI ¶ added in v0.27.0
func (s *EveUniverseService) UpdateOrCreateCorporationFromESI(ctx context.Context, id int32) (*app.EveCorporation, error)
func (*EveUniverseService) UpdateOrCreateLocationESI ¶ added in v0.27.0
func (s *EveUniverseService) UpdateOrCreateLocationESI(ctx context.Context, id int64) (*app.EveLocation, error)
UpdateOrCreateLocationESI tries to fetch and create a new location from ESI.
Important: For creating structures a valid token with the structure scope must be set in the context or an error will be returned
func (*EveUniverseService) UpdateSectionIfNeeded ¶ added in v0.53.0
func (s *EveUniverseService) UpdateSectionIfNeeded(ctx context.Context, arg app.GeneralSectionUpdateParams) (set.Set[int32], error)
UpdateSectionIfNeeded updates a section from ESI and returns the IDs of changed objects if there are any.
func (*EveUniverseService) UpdateShipSkills ¶ added in v0.20.0
func (s *EveUniverseService) UpdateShipSkills(ctx context.Context) error
type Params ¶ added in v0.24.0
type Params struct {
ConcurrencyLimit int // max number of concurrent Goroutines (per group)
ESIClient *goesi.APIClient
StatusCacheService *statuscacheservice.StatusCacheService
Storage *storage.Storage
}