twdataloader

package
v0.0.0-...-f4cb4c1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EndpointConfig                 = "/interface.php?func=get_config"
	EndpointUnitConfig             = "/interface.php?func=get_unit_info"
	EndpointBuildingConfig         = "/interface.php?func=get_building_info"
	EndpointPlayer                 = "/map/player.txt.gz"
	EndpointPlayerNotGzipped       = "/map/player.txt"
	EndpointTribe                  = "/map/ally.txt.gz"
	EndpointTribeNotGzipped        = "/map/ally.txt"
	EndpointVillage                = "/map/village.txt.gz"
	EndpointVillageNotGzipped      = "/map/village.txt"
	EndpointKillAtt                = "/map/kill_att.txt.gz"
	EndpointKillAttNotGzipped      = "/map/kill_att.txt"
	EndpointKillDef                = "/map/kill_def.txt.gz"
	EndpointKillDefNotGzipped      = "/map/kill_def.txt"
	EndpointKillSup                = "/map/kill_sup.txt.gz"
	EndpointKillSupNotGzipped      = "/map/kill_sup.txt"
	EndpointKillAll                = "/map/kill_all.txt.gz"
	EndpointKillAllNotGzipped      = "/map/kill_all.txt"
	EndpointKillAttTribe           = "/map/kill_att_tribe.txt.gz"
	EndpointKillAttTribeNotGzipped = "/map/kill_att_tribe.txt"
	EndpointKillDefTribe           = "/map/kill_def_tribe.txt.gz"
	EndpointKillDefTribeNotGzipped = "/map/kill_def_tribe.txt"
	EndpointKillAllTribe           = "/map/kill_all_tribe.txt.gz"
	EndpointKillAllTribeNotGzipped = "/map/kill_all_tribe.txt"
	EndpointConquer                = "/map/conquer.txt.gz"
	EndpointConquerNotGzipped      = "/map/conquer.txt"

	EndpointGetConquer = endpointInterface + "?func=get_conquer&since=%d"
	EndpointGetServers = "/backend/get_servers.php"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LoadEnnoblementsConfig

type LoadEnnoblementsConfig struct {
	EnnobledAtGT time.Time
}

type Server

type Server struct {
	Key string
	URL string
}

type ServerDataLoader

type ServerDataLoader struct {
	// contains filtered or unexported fields
}

func NewServerDataLoader

func NewServerDataLoader(cfg *ServerDataLoaderConfig) *ServerDataLoader

func (*ServerDataLoader) GetBuildingConfig

func (dl *ServerDataLoader) GetBuildingConfig() (*twmodel.BuildingConfig, error)

func (*ServerDataLoader) GetConfig

func (dl *ServerDataLoader) GetConfig() (*twmodel.ServerConfig, error)

func (*ServerDataLoader) GetUnitConfig

func (dl *ServerDataLoader) GetUnitConfig() (*twmodel.UnitConfig, error)

func (*ServerDataLoader) LoadEnnoblements

func (dl *ServerDataLoader) LoadEnnoblements(cfg *LoadEnnoblementsConfig) ([]*twmodel.Ennoblement, error)

func (*ServerDataLoader) LoadOD

func (dl *ServerDataLoader) LoadOD(tribe bool) (map[int]*twmodel.OpponentsDefeated, error)

func (*ServerDataLoader) LoadPlayers

func (dl *ServerDataLoader) LoadPlayers() ([]*twmodel.Player, error)

func (*ServerDataLoader) LoadTribes

func (dl *ServerDataLoader) LoadTribes() ([]*twmodel.Tribe, error)

func (*ServerDataLoader) LoadVillages

func (dl *ServerDataLoader) LoadVillages() ([]*twmodel.Village, error)

type ServerDataLoaderConfig

type ServerDataLoaderConfig struct {
	BaseURL string
	Client  *http.Client
}

type VersionDataLoader

type VersionDataLoader struct {
	// contains filtered or unexported fields
}

func NewVersionDataLoader

func NewVersionDataLoader(cfg *VersionDataLoaderConfig) *VersionDataLoader

func (*VersionDataLoader) LoadServers

func (dl *VersionDataLoader) LoadServers() ([]*Server, error)

type VersionDataLoaderConfig

type VersionDataLoaderConfig struct {
	Host   string
	Client *http.Client
}

Jump to

Keyboard shortcuts

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