model

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Code    string `json:"code" enums:"entity-not-found,route-not-found,method-not-allowed,validation-error,internal-server-error"`
	Message string `json:"message"`

} // @name ApiError

type Building

type Building struct {
	MaxLevel        int8    `json:"maxLevel"`
	MinLevel        int8    `json:"minLevel"`
	Wood            int32   `json:"wood"`
	Stone           int32   `json:"stone"`
	Iron            int32   `json:"iron"`
	Pop             int16   `json:"pop"`
	WoodFactor      float64 `json:"woodFactor"`
	StoneFactor     float64 `json:"stoneFactor"`
	IronFactor      float64 `json:"ironFactor"`
	PopFactor       float64 `json:"popFactor"`
	BuildTime       float64 `json:"buildTime"`
	BuildTimeFactor float64 `json:"buildTimeFactor"`

} // @name Building

type BuildingInfo

type BuildingInfo struct {
	Main       Building `json:"main"`
	Barracks   Building `json:"barracks"`
	Stable     Building `json:"stable"`
	Garage     Building `json:"garage"`
	Watchtower Building `json:"watchtower"`
	Snob       Building `json:"snob"`
	Smith      Building `json:"smith"`
	Place      Building `json:"place"`
	Statue     Building `json:"statue"`
	Market     Building `json:"market"`
	Wood       Building `json:"wood"`
	Stone      Building `json:"stone"`
	Iron       Building `json:"iron"`
	Farm       Building `json:"farm"`
	Storage    Building `json:"storage"`
	Hide       Building `json:"hide"`
	Wall       Building `json:"wall"`

} // @name BuildingInfo

func NewBuildingInfo

func NewBuildingInfo(info domain.BuildingInfo) BuildingInfo

type Ennoblement

type Ennoblement struct {
	ID        int64          `json:"id"`
	Village   VillageMeta    `json:"village"`
	NewOwner  NullPlayerMeta `json:"newOwner" extensions:"x-nullable"`
	OldOwner  NullPlayerMeta `json:"oldOwner" extensions:"x-nullable"`
	Points    int64          `json:"points"`
	CreatedAt time.Time      `json:"createdAt" format:"date-time"`

} // @name Ennoblement

func NewEnnoblement

func NewEnnoblement(e domain.Ennoblement) Ennoblement

type ErrorResp

type ErrorResp struct {
	Error APIError `json:"error"`

} // @name ErrorResp

type ExtendedServer

type ExtendedServer struct {
	Server
	Config       ServerConfig `json:"config"`
	BuildingInfo BuildingInfo `json:"buildingInfo"`
	UnitInfo     UnitInfo     `json:"unitInfo"`

} // @name ExtendedServer

func NewExtendedServer

func NewExtendedServer(s domain.Server) ExtendedServer

type GetPlayerResp

type GetPlayerResp struct {
	Data Player `json:"data"`

} // @name GetPlayerResp

func NewGetPlayerResp

func NewGetPlayerResp(v domain.Player) GetPlayerResp

type GetServerResp

type GetServerResp struct {
	Data ExtendedServer `json:"data"`

} // @name GetServerResp

func NewGetServerResp

func NewGetServerResp(v domain.Server) GetServerResp

type GetTribeResp

type GetTribeResp struct {
	Data Tribe `json:"data"`

} // @name GetTribeResp

func NewGetTribeResp

func NewGetTribeResp(v domain.Tribe) GetTribeResp

type GetVersionResp

type GetVersionResp struct {
	Data Version `json:"data"`

} // @name GetVersionResp

func NewGetVersionResp

func NewGetVersionResp(v domain.Version) GetVersionResp

type GetVillageResp

type GetVillageResp struct {
	Data Village `json:"data"`

} // @name GetVillageResp

func NewGetVillageResp

func NewGetVillageResp(v domain.Village) GetVillageResp

type ListEnnoblementsResp

type ListEnnoblementsResp struct {
	Data []Ennoblement `json:"data"`

} // @name ListEnnoblementsResp

func NewListEnnoblementsResp

func NewListEnnoblementsResp(ennoblements []domain.Ennoblement) ListEnnoblementsResp

type ListPlayersResp

type ListPlayersResp struct {
	Data []Player `json:"data"`

} // @name ListPlayersResp

func NewListPlayersResp

func NewListPlayersResp(players []domain.Player) ListPlayersResp

type ListServersResp

type ListServersResp struct {
	Data []Server `json:"data"`

} // @name ListServersResp

func NewListServersResp

func NewListServersResp(servers []domain.Server) ListServersResp

type ListTribesResp

type ListTribesResp struct {
	Data []Tribe `json:"data"`

} // @name ListTribesResp

func NewListTribesResp

func NewListTribesResp(tribes []domain.Tribe) ListTribesResp

type ListVersionsResp

type ListVersionsResp struct {
	Data []Version `json:"data"`

} // @name ListVersionsResp

func NewListVersionsResp

func NewListVersionsResp(versions []domain.Version) ListVersionsResp

type ListVillagesResp

type ListVillagesResp struct {
	Data []Village `json:"data"`

} // @name ListVillagesResp

func NewListVillagesResp

func NewListVillagesResp(villages []domain.Village) ListVillagesResp

type NullPlayerMeta

type NullPlayerMeta struct {
	Player PlayerMeta
	Valid  bool
}

func (NullPlayerMeta) MarshalJSON

func (p NullPlayerMeta) MarshalJSON() ([]byte, error)

func (*NullPlayerMeta) UnmarshalJSON

func (p *NullPlayerMeta) UnmarshalJSON(data []byte) error

type NullTime

type NullTime struct {
	Time  time.Time
	Valid bool
}

func (NullTime) MarshalJSON

func (t NullTime) MarshalJSON() ([]byte, error)

func (*NullTime) UnmarshalJSON

func (t *NullTime) UnmarshalJSON(data []byte) error

type NullTribeMeta

type NullTribeMeta struct {
	Tribe TribeMeta
	Valid bool
}

func (NullTribeMeta) MarshalJSON

func (t NullTribeMeta) MarshalJSON() ([]byte, error)

func (*NullTribeMeta) UnmarshalJSON

func (t *NullTribeMeta) UnmarshalJSON(data []byte) error

type Player

type Player struct {
	ID          int64         `json:"id"`
	Name        string        `json:"name"`
	NumVillages int64         `json:"numVillages"`
	Points      int64         `json:"points"`
	Rank        int64         `json:"rank"`
	Tribe       NullTribeMeta `json:"tribe" extensions:"x-nullable"`
	RankAtt     int64         `json:"rankAtt"`
	ScoreAtt    int64         `json:"scoreAtt"`
	RankDef     int64         `json:"rankDef"`
	ScoreDef    int64         `json:"scoreDef"`
	RankSup     int64         `json:"rankSup"`
	ScoreSup    int64         `json:"scoreSup"`
	RankTotal   int64         `json:"rankTotal"`
	ScoreTotal  int64         `json:"scoreTotal"`
	CreatedAt   time.Time     `json:"createdAt" format:"date-time"`
	DeletedAt   NullTime      `json:"deletedAt" swaggertype:"string" format:"date-time" extensions:"x-nullable"`

} // @name Player

func NewPlayer

func NewPlayer(p domain.Player) Player

type PlayerMeta

type PlayerMeta struct {
	ID    int64         `json:"id"`
	Name  string        `json:"name"`
	Tribe NullTribeMeta `json:"tribe" extensions:"x-nullable"`

} // @name PlayerMeta

PlayerMeta represents basic player information @Description Basic player information

func NewPlayerMeta

func NewPlayerMeta(p domain.Player) PlayerMeta

type Server

type Server struct {
	Key                  string    `json:"key" example:"pl151"`
	URL                  string    `json:"url" example:"https://pl151.plemiona.pl"`
	Open                 bool      `json:"open"`
	NumPlayers           int64     `json:"numPlayers"`
	NumTribes            int64     `json:"numTribes"`
	NumVillages          int64     `json:"numVillages"`
	CreatedAt            time.Time `json:"createdAt" format:"date-time"`
	PlayerDataUpdatedAt  NullTime  `json:"playerDataUpdatedAt" swaggertype:"string" format:"date-time" extensions:"x-nullable"`
	TribeDataUpdatedAt   NullTime  `json:"tribeDataUpdatedAt" swaggertype:"string" format:"date-time" extensions:"x-nullable"`
	VillageDataUpdatedAt NullTime  `json:"villageDataUpdatedAt" swaggertype:"string" format:"date-time" extensions:"x-nullable"`

} // @name Server

func NewServer

func NewServer(s domain.Server) Server

type ServerConfig

type ServerConfig struct {
	Speed     float64               `json:"speed"`
	UnitSpeed float64               `json:"unitSpeed"`
	Moral     int16                 `json:"moral"`
	Build     ServerConfigBuild     `json:"build"`
	Misc      ServerConfigMisc      `json:"misc"`
	Commands  ServerConfigCommands  `json:"commands"`
	Newbie    ServerConfigNewbie    `json:"newbie"`
	Game      ServerConfigGame      `json:"game"`
	Buildings ServerConfigBuildings `json:"buildings"`
	Snob      ServerConfigSnob      `json:"snob"`
	Ally      ServerConfigAlly      `json:"ally"`
	Coord     ServerConfigCoord     `json:"coord"`
	Sitter    ServerConfigSitter    `json:"sitter"`
	Sleep     ServerConfigSleep     `json:"sleep"`
	Night     ServerConfigNight     `json:"night"`
	Win       ServerConfigWin       `json:"win"`

} // @name ServerConfig

func NewServerConfig

func NewServerConfig(cfg domain.ServerConfig) ServerConfig

type ServerConfigAlly

type ServerConfigAlly struct {
	NoHarm                int8   `json:"noHarm"`
	NoOtherSupport        int8   `json:"noOtherSupport"`
	NoOtherSupportType    int8   `json:"noOtherSupportType"`
	AllytimeSupport       int32  `json:"allytimeSupport"`
	NoLeave               int8   `json:"noLeave"`
	NoJoin                int8   `json:"noJoin"`
	Limit                 int16  `json:"limit"`
	FixedAllies           int8   `json:"fixedAllies"`
	PointsMemberCount     int32  `json:"pointsMemberCount"`
	WarsMemberRequirement int16  `json:"warsMemberRequirement"`
	WarsPointsRequirement int32  `json:"warsPointsRequirement"`
	WarsAutoacceptDays    int16  `json:"warsAutoacceptDays"`
	Levels                int8   `json:"levels"`
	XpRequirements        string `json:"xpRequirements"`

} // @name ServerConfigAlly

type ServerConfigBuild

type ServerConfigBuild struct {
	Destroy int8 `json:"destroy"`

} // @name ServerConfigBuild

type ServerConfigBuildings

type ServerConfigBuildings struct {
	CustomMain       int8 `json:"customMain"`
	CustomFarm       int8 `json:"customFarm"`
	CustomStorage    int8 `json:"customStorage"`
	CustomPlace      int8 `json:"customPlace"`
	CustomBarracks   int8 `json:"customBarracks"`
	CustomChurch     int8 `json:"customChurch"`
	CustomSmith      int8 `json:"customSmith"`
	CustomWood       int8 `json:"customWood"`
	CustomStone      int8 `json:"customStone"`
	CustomIron       int8 `json:"customIron"`
	CustomMarket     int8 `json:"customMarket"`
	CustomStable     int8 `json:"customStable"`
	CustomWall       int8 `json:"customWall"`
	CustomGarage     int8 `json:"customGarage"`
	CustomHide       int8 `json:"customHide"`
	CustomSnob       int8 `json:"customSnob"`
	CustomStatue     int8 `json:"customStatue"`
	CustomWatchtower int8 `json:"customWatchtower"`

} // @name ServerConfigBuildings

type ServerConfigCommands

type ServerConfigCommands struct {
	MillisArrival     int16 `json:"millisArrival"`
	CommandCancelTime int16 `json:"commandCancelTime"`

} // @name ServerConfigCommands

type ServerConfigCoord

type ServerConfigCoord struct {
	MapSize         int16 `json:"mapSize"`
	Func            int8  `json:"func"`
	EmptyVillages   int16 `json:"emptyVillages"`
	BonusVillages   int16 `json:"bonusVillages"`
	BonusNew        int16 `json:"bonusNew"`
	Inner           int16 `json:"inner"`
	SelectStart     int8  `json:"selectStart"`
	VillageMoveWait int32 `json:"villageMoveWait"`
	NobleRestart    int8  `json:"nobleRestart"`
	StartVillages   int8  `json:"startVillages"`

} // @name ServerConfigCoord

type ServerConfigGame

type ServerConfigGame struct {
	BuildtimeFormula   int8    `json:"buildtimeFormula"`
	Knight             int8    `json:"knight"`
	KnightNewItems     int8    `json:"knightNewItems"`
	Archer             int8    `json:"archer"`
	Tech               int8    `json:"tech"`
	FarmLimit          int32   `json:"farmLimit"`
	Church             int8    `json:"church"`
	Watchtower         int8    `json:"watchtower"`
	Stronghold         int8    `json:"stronghold"`
	FakeLimit          float64 `json:"fakeLimit"`
	BarbarianRise      float64 `json:"barbarianRise"`
	BarbarianShrink    int8    `json:"barbarianShrink"`
	BarbarianMaxPoints int32   `json:"barbarianMaxPoints"`
	Hauls              int8    `json:"hauls"`
	HaulsBase          int32   `json:"haulsBase"`
	HaulsMax           int32   `json:"haulsMax"`
	BaseProduction     int32   `json:"baseProduction"`
	Event              int16   `json:"event"`
	SuppressEvents     int8    `json:"suppressEvents"`

} // @name ServerConfigGame

type ServerConfigMisc

type ServerConfigMisc struct {
	KillRanking     int8  `json:"killRanking"`
	Tutorial        int8  `json:"tutorial"`
	TradeCancelTime int16 `json:"tradeCancelTime"`

} // @name ServerConfigMisc

type ServerConfigNewbie

type ServerConfigNewbie struct {
	Days                 int16 `json:"days"`
	RatioDays            int16 `json:"ratioDays"`
	Ratio                int16 `json:"ratio"`
	RemoveNewbieVillages int8  `json:"removeNewbieVillages"`

} // @name ServerConfigNewbie

type ServerConfigNight

type ServerConfigNight struct {
	Active    int8    `json:"active"`
	StartHour int8    `json:"startHour"`
	EndHour   int8    `json:"endHour"`
	DefFactor float64 `json:"defFactor"`
	Duration  int8    `json:"duration"`

} // @name ServerConfigNight

type ServerConfigSitter

type ServerConfigSitter struct {
	Allow int8 `json:"allow"`

} // @name ServerConfigSitter

type ServerConfigSleep

type ServerConfigSleep struct {
	Active   int8  `json:"active"`
	Delay    int32 `json:"delay"`
	Min      int16 `json:"min"`
	Max      int16 `json:"max"`
	MinAwake int16 `json:"minAwake"`
	MaxAwake int16 `json:"maxAwake"`
	WarnTime int16 `json:"warnTime"`

} // @name ServerConfigSleep

type ServerConfigSnob

type ServerConfigSnob struct {
	Gold          int8    `json:"gold"`
	CheapRebuild  int8    `json:"cheapRebuild"`
	Rise          int8    `json:"rise"`
	MaxDist       int16   `json:"maxDist"`
	Factor        float64 `json:"factor"`
	CoinWood      int32   `json:"coinWood"`
	CoinStone     int32   `json:"coinStone"`
	CoinIron      int32   `json:"coinIron"`
	NoBarbConquer int8    `json:"noBarbConquer"`

} // @name ServerConfigSnob

type ServerConfigWin

type ServerConfigWin struct {
	Check int16 `json:"check"`

} // @name ServerConfigWin

type Tribe

type Tribe struct {
	ID          int64     `json:"id"`
	Name        string    `json:"name"`
	Tag         string    `json:"tag"`
	NumMembers  int64     `json:"numMembers"`
	NumVillages int64     `json:"numVillages"`
	Points      int64     `json:"points"`
	AllPoints   int64     `json:"allPoints"`
	Rank        int64     `json:"rank"`
	Dominance   float64   `json:"dominance"`
	RankAtt     int64     `json:"rankAtt"`
	ScoreAtt    int64     `json:"scoreAtt"`
	RankDef     int64     `json:"rankDef"`
	ScoreDef    int64     `json:"scoreDef"`
	RankTotal   int64     `json:"rankTotal"`
	ScoreTotal  int64     `json:"scoreTotal"`
	CreatedAt   time.Time `json:"createdAt" format:"date-time"`
	DeletedAt   NullTime  `json:"deletedAt" swaggertype:"string" format:"date-time" extensions:"x-nullable"`

} // @name Tribe

func NewTribe

func NewTribe(t domain.Tribe) Tribe

type TribeMeta

type TribeMeta struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	Tag  string `json:"tag"`

} // @name TribeMeta

TribeMeta represents basic tribe information @Description Basic tribe information

func NewTribeMeta

func NewTribeMeta(t domain.Tribe) TribeMeta

type Unit

type Unit struct {
	BuildTime      float64 `json:"buildTime"`
	Pop            int16   `json:"pop"`
	Speed          float64 `json:"speed"`
	Attack         int16   `json:"attack"`
	Defense        int16   `json:"defense"`
	DefenseCavalry int16   `json:"defenseCavalry"`
	DefenseArcher  int16   `json:"defenseArcher"`
	Carry          int16   `json:"carry"`

} // @name Unit

type UnitInfo

type UnitInfo struct {
	Spear    Unit `json:"spear"`
	Sword    Unit `json:"sword"`
	Axe      Unit `json:"axe"`
	Archer   Unit `json:"archer"`
	Spy      Unit `json:"spy"`
	Light    Unit `json:"light"`
	Marcher  Unit `json:"marcher"`
	Heavy    Unit `json:"heavy"`
	Ram      Unit `json:"ram"`
	Catapult Unit `json:"catapult"`
	Knight   Unit `json:"knight"`
	Snob     Unit `json:"snob"`
	Militia  Unit `json:"militia"`

} // @name UnitInfo

func NewUnitInfo

func NewUnitInfo(info domain.UnitInfo) UnitInfo

type Version

type Version struct {
	Code     string `json:"code" example:"pl"`
	Name     string `json:"name" example:"Poland"`
	Host     string `json:"host" example:"plemiona.pl"`
	Timezone string `json:"timezone" example:"Europe/Warsaw"`

} // @name Version

func NewVersion

func NewVersion(v domain.Version) Version

type Village

type Village struct {
	ID        int64          `json:"id"`
	Name      string         `json:"name" example:"Village"`
	FullName  string         `json:"fullName" example:"Village (450|450) K44"`
	Points    int64          `json:"points"`
	X         int64          `json:"x" example:"450"`
	Y         int64          `json:"y" example:"450"`
	Continent string         `json:"continent" example:"K44"`
	Bonus     int64          `json:"bonus"`
	Player    NullPlayerMeta `json:"player" extensions:"x-nullable"`
	CreatedAt time.Time      `json:"createdAt" format:"date-time"`

} // @name Village

func NewVillage

func NewVillage(v domain.Village) Village

type VillageMeta

type VillageMeta struct {
	ID       int64  `json:"id"`
	FullName string `json:"fullName" example:"Village (450|450) K44"`

} // @name VillageMeta

VillageMeta represents basic village information @Description Basic village information

func NewVillageMeta

func NewVillageMeta(v domain.Village) VillageMeta

Jump to

Keyboard shortcuts

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