Documentation ¶
Index ¶
- Variables
- func ParseAjaxPage[T AjaxPagePages](e extractor.Extractor, pageHTML []byte) (T, error)
- func ParsePage[T FullPagePages](e extractor.Extractor, pageHTML []byte) (*T, error)
- type AjaxPagePages
- type AllianceOverviewTabAjaxPage
- type AllianceOverviewTabRes
- type DefensesPage
- type EventListAjaxPage
- type FacilitiesPage
- type FetchTechsAjaxPage
- type FleetDispatchPage
- type FullPage
- func (p *FullPage) ExtractAdmiral() bool
- func (p *FullPage) ExtractAjaxChatToken() (string, error)
- func (p *FullPage) ExtractCelestial(v any) (ogame.Celestial, error)
- func (p *FullPage) ExtractCelestials() ([]ogame.Celestial, error)
- func (p *FullPage) ExtractCharacterClass() (ogame.CharacterClass, error)
- func (p *FullPage) ExtractColonies() (int64, int64)
- func (p *FullPage) ExtractCommander() bool
- func (p *FullPage) ExtractEngineer() bool
- func (p *FullPage) ExtractGeologist() bool
- func (p *FullPage) ExtractIsInVacation() bool
- func (p *FullPage) ExtractLifeformEnabled() bool
- func (p *FullPage) ExtractLifeformTypeFromDoc() ogame.LifeformType
- func (p *FullPage) ExtractMoon(v any) (ogame.Moon, error)
- func (p *FullPage) ExtractMoons() []ogame.Moon
- func (p *FullPage) ExtractOGameSession() string
- func (p *FullPage) ExtractPlanet(v any) (ogame.Planet, error)
- func (p *FullPage) ExtractPlanetCoordinate() (ogame.Coordinate, error)
- func (p *FullPage) ExtractPlanetID() (ogame.CelestialID, error)
- func (p *FullPage) ExtractPlanets() []ogame.Planet
- func (p *FullPage) ExtractResources() ogame.Resources
- func (p *FullPage) ExtractServerTime() (time.Time, error)
- func (p *FullPage) ExtractTechnocrat() bool
- func (p *FullPage) ExtractToken() (string, error)
- type FullPagePages
- type IFullPage
- type JumpGateAjaxPage
- type LfBonusesPage
- type LfBuildingsPage
- type LfResearchPage
- type MissileAttackLayerAjaxPage
- type MovementPage
- type OverviewPage
- func (p *OverviewPage) ExtractActiveItems() ([]ogame.ActiveItem, error)
- func (p *OverviewPage) ExtractCancelBuildingInfos() (token string, techID, listID int64, err error)
- func (p *OverviewPage) ExtractCancelLfBuildingInfos() (token string, id, listID int64, err error)
- func (p *OverviewPage) ExtractCancelResearchInfos() (token string, techID, listID int64, err error)
- func (p *OverviewPage) ExtractConstructions() (ogame.ID, int64, ogame.ID, int64, ogame.ID, int64, ogame.ID, int64)
- func (p *OverviewPage) ExtractDMCosts() (ogame.DMCosts, error)
- func (p *OverviewPage) ExtractUserInfos() (ogame.UserInfos, error)
- type Page
- type PhalanxAjaxPage
- type PreferencesPage
- type ResearchPage
- type ResourcesSettingsPage
- type RocketlayerAjaxPage
- type ShipyardPage
- type SuppliesPage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrParsePageType = errors.New("failed to parse requested page type")
Functions ¶
func ParseAjaxPage ¶
func ParseAjaxPage[T AjaxPagePages](e extractor.Extractor, pageHTML []byte) (T, error)
Types ¶
type AjaxPagePages ¶
type AjaxPagePages interface { EventListAjaxPage | MissileAttackLayerAjaxPage | FetchTechsAjaxPage | RocketlayerAjaxPage | PhalanxAjaxPage | JumpGateAjaxPage | AllianceOverviewTabAjaxPage }
type AllianceOverviewTabAjaxPage ¶
type AllianceOverviewTabAjaxPage struct{ Page }
func (*AllianceOverviewTabAjaxPage) ExtractAllianceClass ¶
func (p *AllianceOverviewTabAjaxPage) ExtractAllianceClass() (ogame.AllianceClass, error)
type AllianceOverviewTabRes ¶
type AllianceOverviewTabRes struct { Target string `json:"target"` Content struct { AllianceAllianceOverview string `json:"alliance/alliance_overview"` } `json:"content"` Files struct { Js []string `json:"js"` CSS []string `json:"css"` } `json:"files"` Page struct { StateObj string `json:"stateObj"` Title string `json:"title"` URL string `json:"url"` } `json:"page"` ServerTime int `json:"serverTime"` NewAjaxToken string `json:"newAjaxToken"` }
type DefensesPage ¶
type DefensesPage struct{ FullPage }
func (*DefensesPage) ExtractDefense ¶
func (p *DefensesPage) ExtractDefense() (ogame.DefensesInfos, error)
type EventListAjaxPage ¶
type EventListAjaxPage struct{ Page }
func (*EventListAjaxPage) ExtractAttacks ¶
func (p *EventListAjaxPage) ExtractAttacks(ownCoords []ogame.Coordinate) ([]ogame.AttackEvent, error)
type FacilitiesPage ¶
type FacilitiesPage struct{ FullPage }
func (*FacilitiesPage) ExtractFacilities ¶
func (p *FacilitiesPage) ExtractFacilities() (ogame.Facilities, error)
type FetchTechsAjaxPage ¶
type FetchTechsAjaxPage struct{ Page }
func (*FetchTechsAjaxPage) ExtractTechs ¶
func (p *FetchTechsAjaxPage) ExtractTechs() (ogame.ResourcesBuildings, ogame.Facilities, ogame.ShipsInfos, ogame.DefensesInfos, ogame.Researches, ogame.LfBuildings, ogame.LfResearches, error)
type FleetDispatchPage ¶
type FleetDispatchPage struct{ FullPage }
func (*FleetDispatchPage) ExtractAcsValues ¶
func (p *FleetDispatchPage) ExtractAcsValues() []ogame.ACSValues
func (*FleetDispatchPage) ExtractShips ¶
func (p *FleetDispatchPage) ExtractShips() (ogame.ShipsInfos, error)
func (*FleetDispatchPage) ExtractSlots ¶
func (p *FleetDispatchPage) ExtractSlots() (ogame.Slots, error)
type FullPage ¶
type FullPage struct{ Page }
func (*FullPage) ExtractAdmiral ¶
func (*FullPage) ExtractAjaxChatToken ¶
func (*FullPage) ExtractCelestial ¶
func (*FullPage) ExtractCelestials ¶
func (*FullPage) ExtractCharacterClass ¶
func (p *FullPage) ExtractCharacterClass() (ogame.CharacterClass, error)
func (*FullPage) ExtractColonies ¶
func (*FullPage) ExtractCommander ¶
func (*FullPage) ExtractEngineer ¶
func (*FullPage) ExtractGeologist ¶
func (*FullPage) ExtractIsInVacation ¶
func (*FullPage) ExtractLifeformEnabled ¶
func (*FullPage) ExtractLifeformTypeFromDoc ¶
func (p *FullPage) ExtractLifeformTypeFromDoc() ogame.LifeformType
func (*FullPage) ExtractMoons ¶
func (*FullPage) ExtractOGameSession ¶
func (*FullPage) ExtractPlanetCoordinate ¶
func (p *FullPage) ExtractPlanetCoordinate() (ogame.Coordinate, error)
func (*FullPage) ExtractPlanetID ¶
func (p *FullPage) ExtractPlanetID() (ogame.CelestialID, error)
func (*FullPage) ExtractPlanets ¶
func (*FullPage) ExtractResources ¶
func (*FullPage) ExtractTechnocrat ¶
func (*FullPage) ExtractToken ¶
type FullPagePages ¶
type FullPagePages interface { OverviewPage | PreferencesPage | SuppliesPage | ResourcesSettingsPage | LfBonusesPage | FacilitiesPage | LfBuildingsPage | LfResearchPage | ResearchPage | ShipyardPage | FleetDispatchPage | DefensesPage | MovementPage }
type IFullPage ¶
type IFullPage interface { ExtractLifeformTypeFromDoc() ogame.LifeformType ExtractOGameSession() string ExtractIsInVacation() bool ExtractPlanets() []ogame.Planet ExtractPlanetID() (ogame.CelestialID, error) ExtractPlanetCoordinate() (ogame.Coordinate, error) ExtractAjaxChatToken() (string, error) ExtractToken() (string, error) ExtractCharacterClass() (ogame.CharacterClass, error) ExtractCommander() bool ExtractAdmiral() bool ExtractEngineer() bool ExtractGeologist() bool ExtractTechnocrat() bool ExtractColonies() (int64, int64) ExtractServerTime() (time.Time, error) ExtractResources() ogame.Resources }
type JumpGateAjaxPage ¶
type JumpGateAjaxPage struct{ Page }
func (*JumpGateAjaxPage) ExtractJumpGate ¶
func (p *JumpGateAjaxPage) ExtractJumpGate() (ogame.ShipsInfos, string, []ogame.MoonID, int64)
type LfBonusesPage ¶
type LfBonusesPage struct{ FullPage }
func (*LfBonusesPage) ExtractLfBonuses ¶
func (p *LfBonusesPage) ExtractLfBonuses() (ogame.LfBonuses, error)
type LfBuildingsPage ¶
type LfBuildingsPage struct{ FullPage }
func (*LfBuildingsPage) ExtractLfBuildings ¶
func (p *LfBuildingsPage) ExtractLfBuildings() (ogame.LfBuildings, error)
type LfResearchPage ¶
type LfResearchPage struct{ FullPage }
func (*LfResearchPage) ExtractArtefacts ¶
func (p *LfResearchPage) ExtractArtefacts() (int64, int64)
func (*LfResearchPage) ExtractLfResearch ¶
func (p *LfResearchPage) ExtractLfResearch() (ogame.LfResearches, error)
func (*LfResearchPage) ExtractLfSlots ¶
func (p *LfResearchPage) ExtractLfSlots() [18]ogame.LfSlot
type MissileAttackLayerAjaxPage ¶
type MissileAttackLayerAjaxPage struct{ Page }
func (*MissileAttackLayerAjaxPage) ExtractIPM ¶
func (p *MissileAttackLayerAjaxPage) ExtractIPM() (int64, int64, string)
type MovementPage ¶
type MovementPage struct{ FullPage }
func (*MovementPage) ExtractCancelFleetToken ¶
func (p *MovementPage) ExtractCancelFleetToken(fleetID ogame.FleetID) (string, error)
func (*MovementPage) ExtractFleets ¶
func (p *MovementPage) ExtractFleets() []ogame.Fleet
func (*MovementPage) ExtractSlots ¶
func (p *MovementPage) ExtractSlots() (ogame.Slots, error)
type OverviewPage ¶
type OverviewPage struct{ FullPage }
func (*OverviewPage) ExtractActiveItems ¶
func (p *OverviewPage) ExtractActiveItems() ([]ogame.ActiveItem, error)
func (*OverviewPage) ExtractCancelBuildingInfos ¶
func (p *OverviewPage) ExtractCancelBuildingInfos() (token string, techID, listID int64, err error)
func (*OverviewPage) ExtractCancelLfBuildingInfos ¶
func (p *OverviewPage) ExtractCancelLfBuildingInfos() (token string, id, listID int64, err error)
func (*OverviewPage) ExtractCancelResearchInfos ¶
func (p *OverviewPage) ExtractCancelResearchInfos() (token string, techID, listID int64, err error)
func (*OverviewPage) ExtractConstructions ¶
func (*OverviewPage) ExtractDMCosts ¶
func (p *OverviewPage) ExtractDMCosts() (ogame.DMCosts, error)
func (*OverviewPage) ExtractUserInfos ¶
func (p *OverviewPage) ExtractUserInfos() (ogame.UserInfos, error)
type Page ¶
type Page struct {
// contains filtered or unexported fields
}
func (*Page) GetContent ¶
func (*Page) SetExtractor ¶
type PhalanxAjaxPage ¶
type PhalanxAjaxPage struct{ Page }
func (*PhalanxAjaxPage) ExtractPhalanx ¶
func (p *PhalanxAjaxPage) ExtractPhalanx() ([]ogame.PhalanxFleet, error)
func (*PhalanxAjaxPage) ExtractPhalanxNewToken ¶
func (p *PhalanxAjaxPage) ExtractPhalanxNewToken() (string, error)
type PreferencesPage ¶
type PreferencesPage struct{ FullPage }
func (*PreferencesPage) ExtractPreferences ¶
func (p *PreferencesPage) ExtractPreferences() ogame.Preferences
type ResearchPage ¶
type ResearchPage struct{ FullPage }
func (*ResearchPage) ExtractResearch ¶
func (p *ResearchPage) ExtractResearch() ogame.Researches
type ResourcesSettingsPage ¶
type ResourcesSettingsPage struct{ FullPage }
func (*ResourcesSettingsPage) ExtractResourceSettings ¶
func (p *ResourcesSettingsPage) ExtractResourceSettings() (ogame.ResourceSettings, string, error)
type RocketlayerAjaxPage ¶
type RocketlayerAjaxPage struct{ Page }
func (*RocketlayerAjaxPage) ExtractDestroyRockets ¶
func (p *RocketlayerAjaxPage) ExtractDestroyRockets() (int64, int64, string, error)
type ShipyardPage ¶
type ShipyardPage struct{ FullPage }
func (*ShipyardPage) ExtractProduction ¶
func (p *ShipyardPage) ExtractProduction() ([]ogame.Quantifiable, int64, error)
func (*ShipyardPage) ExtractShips ¶
func (p *ShipyardPage) ExtractShips() (ogame.ShipsInfos, error)
type SuppliesPage ¶
type SuppliesPage struct{ FullPage }
func (*SuppliesPage) ExtractResourcesBuildings ¶
func (p *SuppliesPage) ExtractResourcesBuildings() (ogame.ResourcesBuildings, error)
Source Files ¶
- allianceOverviewTabAjaxPage.go
- defensesPage.go
- eventListAjaxPage.go
- facilitiesPage.go
- fetchTechsAjaxPage.go
- fleetDispatchPage.go
- fullPage.go
- jumpGateAjaxPage.go
- lfBonusesPage.go
- lfbuildingsPage.go
- lftechsPage.go
- missileAttackLayerAjaxPage.go
- movementPage.go
- overviewPage.go
- parser.go
- phalanxAjaxPage.go
- preferencesPage.go
- researchPage.go
- resourcesSettingsPage.go
- rocketlayerAjaxPage.go
- shipyardPage.go
- suppliesPage.go
Click to show internal directories.
Click to hide internal directories.