Documentation ¶
Index ¶
- Variables
- type Building
- type BuildingInfo
- type Ennoblement
- type Ennoblements
- type OpponentsDefeated
- type Player
- type PlayerSnapshot
- type PlayerSnapshots
- type Players
- type Server
- type ServerConfig
- type ServerConfigAlly
- type ServerConfigBuild
- type ServerConfigBuildings
- type ServerConfigCommands
- type ServerConfigCoord
- type ServerConfigGame
- type ServerConfigMisc
- type ServerConfigNewbie
- type ServerConfigNight
- type ServerConfigSitter
- type ServerConfigSleep
- type ServerConfigSnob
- type ServerConfigWin
- type ServerSnapshot
- type ServerSnapshots
- type Servers
- type Tribe
- type TribeChange
- type TribeChanges
- type TribeSnapshot
- type TribeSnapshots
- type Tribes
- type Unit
- type UnitInfo
- type Version
- type Versions
- type Village
- type Villages
Constants ¶
This section is empty.
Variables ¶
View Source
var PlayerMetaColumns = []string{"id", "name", "profile_url"}
View Source
var ServerMetaColumns = []string{"key", "url", "open"}
View Source
var TribeMetaColumns = []string{"id", "name", "tag", "profile_url"}
View Source
var VillageMetaColumns = []string{"id", "name", "profile_url", "x", "y", "continent"}
Functions ¶
This section is empty.
Types ¶
type BuildingInfo ¶
type BuildingInfo struct { Main Building Barracks Building Stable Building Garage Building Watchtower Building Snob Building Smith Building Place Building Statue Building Market Building Wood Building Stone Building Iron Building Farm Building Storage Building Hide Building Wall Building }
func NewBuildingInfo ¶
func NewBuildingInfo(info domain.BuildingInfo) BuildingInfo
func (BuildingInfo) ToDomain ¶
func (b BuildingInfo) ToDomain() (domain.BuildingInfo, error)
type Ennoblement ¶
type Ennoblement struct { bun.BaseModel `bun:"table:ennoblements,alias:ennoblement"` ID int `bun:"id,pk,autoincrement,identity"` ServerKey string `bun:"server_key,nullzero"` VillageID int `bun:"village_id,nullzero"` Village Village `bun:"village,rel:belongs-to,join:village_id=id,join:server_key=server_key"` NewOwnerID int `bun:"new_owner_id,nullzero"` NewOwner Player `bun:"new_owner,rel:belongs-to,join:new_owner_id=id,join:server_key=server_key"` NewTribeID int `bun:"new_tribe_id,nullzero"` NewTribe Tribe `bun:"new_tribe,rel:belongs-to,join:new_tribe_id=id,join:server_key=server_key"` OldOwnerID int `bun:"old_owner_id,nullzero"` OldOwner Player `bun:"old_owner,rel:belongs-to,join:old_owner_id=id,join:server_key=server_key"` OldTribeID int `bun:"old_tribe_id,nullzero"` OldTribe Tribe `bun:"old_tribe,rel:belongs-to,join:old_tribe_id=id,join:server_key=server_key"` Points int `bun:"points"` CreatedAt time.Time `bun:"created_at,nullzero"` }
func (Ennoblement) ToDomain ¶
func (e Ennoblement) ToDomain() (domain.Ennoblement, error)
func (Ennoblement) ToDomainWithRelations ¶
func (e Ennoblement) ToDomainWithRelations() (domain.EnnoblementWithRelations, error)
type Ennoblements ¶
type Ennoblements []Ennoblement
func (Ennoblements) ToDomain ¶
func (es Ennoblements) ToDomain() (domain.Ennoblements, error)
func (Ennoblements) ToDomainWithRelations ¶
func (es Ennoblements) ToDomainWithRelations() (domain.EnnoblementsWithRelations, error)
type OpponentsDefeated ¶
type OpponentsDefeated struct { RankAtt int `bun:"rank_att"` ScoreAtt int `bun:"score_att"` RankDef int `bun:"rank_def"` ScoreDef int `bun:"score_def"` RankSup int `bun:"rank_sup"` ScoreSup int `bun:"score_sup"` RankTotal int `bun:"rank_total"` ScoreTotal int `bun:"score_total"` }
func NewOpponentsDefeated ¶
func NewOpponentsDefeated(od domain.OpponentsDefeated) OpponentsDefeated
func (OpponentsDefeated) ToDomain ¶
func (od OpponentsDefeated) ToDomain() (domain.OpponentsDefeated, error)
type Player ¶
type Player struct { bun.BaseModel `bun:"table:players,alias:player"` ID int `bun:"id,nullzero,pk"` ServerKey string `bun:"server_key,nullzero,pk"` Server Server `bun:"server,rel:belongs-to,join:server_key=key"` Name string `bun:"name,nullzero"` NumVillages int `bun:"num_villages"` Points int `bun:"points"` Rank int `bun:"rank"` TribeID int `bun:"tribe_id,nullzero"` Tribe Tribe `bun:"tribe,rel:belongs-to,join:tribe_id=id,join:server_key=server_key"` ProfileURL string `bun:"profile_url,nullzero"` BestRank int `bun:"best_rank"` BestRankAt time.Time `bun:"best_rank_at,nullzero,default:CURRENT_TIMESTAMP"` MostPoints int `bun:"most_points"` MostPointsAt time.Time `bun:"most_points_at,nullzero,default:CURRENT_TIMESTAMP"` MostVillages int `bun:"most_villages"` MostVillagesAt time.Time `bun:"most_villages_at,nullzero,default:CURRENT_TIMESTAMP"` LastActivityAt time.Time `bun:"last_activity_at,nullzero,default:CURRENT_TIMESTAMP"` CreatedAt time.Time `bun:"created_at,nullzero,default:CURRENT_TIMESTAMP"` DeletedAt time.Time `bun:"deleted_at,nullzero"` OpponentsDefeated }
func (Player) ToDomainWithRelations ¶
func (p Player) ToDomainWithRelations() (domain.PlayerWithRelations, error)
func (Player) ToMetaWithRelations ¶
func (p Player) ToMetaWithRelations() (domain.PlayerMetaWithRelations, error)
type PlayerSnapshot ¶
type PlayerSnapshot struct { bun.BaseModel `bun:"table:player_snapshots,alias:ps"` ID int `bun:"id,pk,autoincrement,identity"` PlayerID int `bun:"player_id,nullzero"` TribeID int `bun:"tribe_id,nullzero"` ServerKey string `bun:"server_key,nullzero"` Tribe Tribe `bun:"tribe,rel:belongs-to,join:tribe_id=id,join:server_key=server_key"` Player Player `bun:"player,rel:belongs-to,join:player_id=id,join:server_key=server_key"` NumVillages int `bun:"num_villages"` Points int `bun:"points"` Rank int `bun:"rank"` Date time.Time `bun:"date,nullzero"` CreatedAt time.Time `bun:"created_at,nullzero"` OpponentsDefeated }
func (PlayerSnapshot) ToDomain ¶
func (ps PlayerSnapshot) ToDomain() (domain.PlayerSnapshot, error)
func (PlayerSnapshot) ToDomainWithRelations ¶
func (ps PlayerSnapshot) ToDomainWithRelations() (domain.PlayerSnapshotWithRelations, error)
type PlayerSnapshots ¶
type PlayerSnapshots []PlayerSnapshot
func (PlayerSnapshots) ToDomain ¶
func (pss PlayerSnapshots) ToDomain() (domain.PlayerSnapshots, error)
func (PlayerSnapshots) ToDomainWithRelations ¶
func (pss PlayerSnapshots) ToDomainWithRelations() (domain.PlayerSnapshotsWithRelations, error)
type Players ¶
type Players []Player
func (Players) ToDomainWithRelations ¶
func (ps Players) ToDomainWithRelations() (domain.PlayersWithRelations, error)
type Server ¶
type Server struct { bun.BaseModel `bun:"table:servers,alias:server"` Key string `bun:"key,nullzero,pk"` URL string `bun:"url,nullzero"` Open bool `bun:"open"` Special bool `bun:"special"` NumPlayers int `bun:"num_players"` NumActivePlayers int `bun:"num_active_players"` NumInactivePlayers int `bun:"num_inactive_players"` NumTribes int `bun:"num_tribes"` NumActiveTribes int `bun:"num_active_tribes"` NumInactiveTribes int `bun:"num_inactive_tribes"` NumVillages int `bun:"num_villages"` NumPlayerVillages int `bun:"num_player_villages"` NumBarbarianVillages int `bun:"num_barbarian_villages"` NumBonusVillages int `bun:"num_bonus_villages"` Config ServerConfig `bun:"config"` BuildingInfo BuildingInfo `bun:"building_info"` UnitInfo UnitInfo `bun:"unit_info"` CreatedAt time.Time `bun:"created_at,nullzero"` SnapshotCreatedAt time.Time `bun:"snapshot_created_at,nullzero"` PlayerDataUpdatedAt time.Time `bun:"player_data_synced_at,nullzero"` PlayerSnapshotsCreatedAt time.Time `bun:"player_snapshots_created_at,nullzero"` TribeDataUpdatedAt time.Time `bun:"tribe_data_synced_at,nullzero"` TribeSnapshotsCreatedAt time.Time `bun:"tribe_snapshots_created_at,nullzero"` VillageDataUpdatedAt time.Time `bun:"village_data_synced_at,nullzero"` EnnoblementDataUpdatedAt time.Time `bun:"ennoblement_data_synced_at,nullzero"` VersionCode string `bun:"version_code,nullzero"` }
type ServerConfig ¶
type ServerConfig struct { Speed float64 UnitSpeed float64 Moral int Build ServerConfigBuild Misc ServerConfigMisc Commands ServerConfigCommands Newbie ServerConfigNewbie Game ServerConfigGame Buildings ServerConfigBuildings Snob ServerConfigSnob Ally ServerConfigAlly Coord ServerConfigCoord Sitter ServerConfigSitter Sleep ServerConfigSleep Night ServerConfigNight Win ServerConfigWin }
func NewServerConfig ¶
func NewServerConfig(cfg domain.ServerConfig) ServerConfig
func (ServerConfig) ToDomain ¶
func (s ServerConfig) ToDomain() (domain.ServerConfig, error)
type ServerConfigAlly ¶
type ServerConfigBuild ¶
type ServerConfigBuild struct {
Destroy int
}
type ServerConfigBuildings ¶
type ServerConfigBuildings struct { CustomBarracks int CustomChurch int CustomFarm int CustomGarage int CustomHide int CustomIron int CustomMain int CustomMarket int CustomPlace int CustomSmith int CustomSnob int CustomStable int CustomStatue int CustomStone int CustomStorage int CustomWall int CustomWatchtower int CustomWood int }
type ServerConfigCommands ¶
type ServerConfigCoord ¶
type ServerConfigGame ¶
type ServerConfigGame struct { Archer int BarbarianMaxPoints int BarbarianRise float64 BarbarianShrink int BaseProduction int BuildtimeFormula int Church int Event int FakeLimit float64 FarmLimit int Hauls int HaulsBase int HaulsMax int Knight int KnightNewItems int Scavenging int Stronghold int SuppressEvents int Tech int Watchtower int }
type ServerConfigMisc ¶
type ServerConfigNewbie ¶
type ServerConfigNight ¶
type ServerConfigSitter ¶
type ServerConfigSitter struct {
Allow int
}
type ServerConfigSleep ¶
type ServerConfigSnob ¶
type ServerConfigWin ¶
type ServerConfigWin struct {
Check int
}
type ServerSnapshot ¶ added in v1.1.0
type ServerSnapshot struct { bun.BaseModel `bun:"table:server_snapshots,alias:ss"` ID int `bun:"id,pk,autoincrement,identity"` ServerKey string `bun:"server_key,nullzero"` Server Server `bun:"server,rel:belongs-to,join:server_key=key"` NumPlayers int `bun:"num_players"` NumActivePlayers int `bun:"num_active_players"` NumInactivePlayers int `bun:"num_inactive_players"` NumTribes int `bun:"num_tribes"` NumActiveTribes int `bun:"num_active_tribes"` NumInactiveTribes int `bun:"num_inactive_tribes"` NumVillages int `bun:"num_villages"` NumPlayerVillages int `bun:"num_player_villages"` NumBarbarianVillages int `bun:"num_barbarian_villages"` NumBonusVillages int `bun:"num_bonus_villages"` Date time.Time `bun:"date,nullzero"` CreatedAt time.Time `bun:"created_at,nullzero"` }
func (ServerSnapshot) ToDomain ¶ added in v1.1.0
func (ss ServerSnapshot) ToDomain() (domain.ServerSnapshot, error)
func (ServerSnapshot) ToDomainWithRelations ¶ added in v1.3.0
func (ss ServerSnapshot) ToDomainWithRelations() (domain.ServerSnapshotWithRelations, error)
type ServerSnapshots ¶ added in v1.1.0
type ServerSnapshots []ServerSnapshot
func (ServerSnapshots) ToDomain ¶ added in v1.1.0
func (sss ServerSnapshots) ToDomain() (domain.ServerSnapshots, error)
func (ServerSnapshots) ToDomainWithRelations ¶ added in v1.3.0
func (sss ServerSnapshots) ToDomainWithRelations() (domain.ServerSnapshotsWithRelations, error)
type Tribe ¶
type Tribe struct { bun.BaseModel `bun:"table:tribes,alias:tribe"` ID int `bun:"id,nullzero,pk"` ServerKey string `bun:"server_key,nullzero,pk"` Server Server `bun:"server,rel:belongs-to,join:server_key=key"` Name string `bun:"name,nullzero"` Tag string `bun:"tag,nullzero"` NumMembers int `bun:"num_members"` NumVillages int `bun:"num_villages"` Points int `bun:"points"` AllPoints int `bun:"all_points"` Rank int `bun:"rank"` Dominance float64 `bun:"dominance"` ProfileURL string `bun:"profile_url,nullzero"` BestRank int `bun:"best_rank,nullzero,default:999999"` BestRankAt time.Time `bun:"best_rank_at,nullzero,default:CURRENT_TIMESTAMP"` MostPoints int `bun:"most_points"` MostPointsAt time.Time `bun:"most_points_at,nullzero,default:CURRENT_TIMESTAMP"` MostVillages int `bun:"most_villages"` MostVillagesAt time.Time `bun:"most_villages_at,nullzero,default:CURRENT_TIMESTAMP"` CreatedAt time.Time `bun:"created_at,nullzero,default:CURRENT_TIMESTAMP"` DeletedAt time.Time `bun:"deleted_at,nullzero"` OpponentsDefeated }
func (Tribe) ToDomainWithRelations ¶ added in v1.8.0
func (t Tribe) ToDomainWithRelations() (domain.TribeWithRelations, error)
type TribeChange ¶
type TribeChange struct { bun.BaseModel `bun:"table:tribe_changes,alias:tc"` ID int `bun:"id,pk,autoincrement,identity"` ServerKey string `bun:"server_key,nullzero"` PlayerID int `bun:"player_id,nullzero"` Player Player `bun:"player,rel:belongs-to,join:player_id=id,join:server_key=server_key"` NewTribeID int `bun:"new_tribe_id,nullzero"` NewTribe Tribe `bun:"new_tribe,rel:belongs-to,join:new_tribe_id=id,join:server_key=server_key"` OldTribeID int `bun:"old_tribe_id,nullzero"` OldTribe Tribe `bun:"old_tribe,rel:belongs-to,join:old_tribe_id=id,join:server_key=server_key"` CreatedAt time.Time `bun:"created_at,nullzero"` }
func (TribeChange) ToDomain ¶
func (tc TribeChange) ToDomain() (domain.TribeChange, error)
func (TribeChange) ToDomainWithRelations ¶
func (tc TribeChange) ToDomainWithRelations() (domain.TribeChangeWithRelations, error)
type TribeChanges ¶
type TribeChanges []TribeChange
func (TribeChanges) ToDomain ¶
func (tcs TribeChanges) ToDomain() (domain.TribeChanges, error)
func (TribeChanges) ToDomainWithRelations ¶
func (tcs TribeChanges) ToDomainWithRelations() (domain.TribeChangesWithRelations, error)
type TribeSnapshot ¶
type TribeSnapshot struct { bun.BaseModel `bun:"table:tribe_snapshots,alias:ts"` ID int `bun:"id,pk,autoincrement,identity"` TribeID int `bun:"tribe_id,nullzero"` ServerKey string `bun:"server_key,nullzero"` Tribe Tribe `bun:"tribe,rel:belongs-to,join:tribe_id=id,join:server_key=server_key"` NumMembers int `bun:"num_members"` NumVillages int `bun:"num_villages"` Points int `bun:"points"` AllPoints int `bun:"all_points"` Rank int `bun:"rank"` Dominance float64 `bun:"dominance"` Date time.Time `bun:"date,nullzero"` CreatedAt time.Time `bun:"created_at,nullzero"` OpponentsDefeated }
func (TribeSnapshot) ToDomain ¶
func (ts TribeSnapshot) ToDomain() (domain.TribeSnapshot, error)
func (TribeSnapshot) ToDomainWithRelations ¶
func (ts TribeSnapshot) ToDomainWithRelations() (domain.TribeSnapshotWithRelations, error)
type TribeSnapshots ¶
type TribeSnapshots []TribeSnapshot
func (TribeSnapshots) ToDomain ¶
func (tss TribeSnapshots) ToDomain() (domain.TribeSnapshots, error)
func (TribeSnapshots) ToDomainWithRelations ¶
func (tss TribeSnapshots) ToDomainWithRelations() (domain.TribeSnapshotsWithRelations, error)
type Tribes ¶
type Tribes []Tribe
func (Tribes) ToDomainWithRelations ¶ added in v1.8.0
func (ts Tribes) ToDomainWithRelations() (domain.TribesWithRelations, error)
type UnitInfo ¶
type UnitInfo struct { Spear Unit Sword Unit Axe Unit Archer Unit Spy Unit Light Unit Marcher Unit Heavy Unit Ram Unit Catapult Unit Knight Unit Snob Unit Militia Unit }
func NewUnitInfo ¶
type Version ¶
type Village ¶
type Village struct { bun.BaseModel `bun:"table:villages,alias:village"` ID int `bun:"id,nullzero,pk"` ServerKey string `bun:"server_key,nullzero,pk"` Name string `bun:"name,nullzero"` Points int `bun:"points"` X int `bun:"x"` Y int `bun:"y"` Continent string `bun:"continent"` Bonus int `bun:"bonus"` PlayerID int `bun:"player_id,nullzero"` Player Player `bun:"player,rel:belongs-to,join:player_id=id,join:server_key=server_key"` ProfileURL string `bun:"profile_url,nullzero"` CreatedAt time.Time `bun:"created_at,nullzero"` }
func (Village) ToDomainWithRelations ¶
func (v Village) ToDomainWithRelations() (domain.VillageWithRelations, error)
Click to show internal directories.
Click to hide internal directories.