Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Battle ¶
type Battle struct { ID uuid.UUID `json:"id"` WikiID int `json:"wikiID"` URL string `json:"url"` Name string `json:"name"` PartOf string `json:"partOf"` Summary string `json:"summary"` StartDate dates.Historic `json:"startDate"` EndDate dates.Historic `json:"endDate"` Location locations.Location `json:"location"` Result string `json:"result"` TerritorialChanges string `json:"territorialChanges"` Strength statistics.SideNumbers `json:"strength"` Casualties statistics.SideNumbers `json:"casualties"` Factions FactionsBySide `json:"factions"` Commanders CommandersBySide `json:"commanders"` CommandersByFaction CommandersByFaction `json:"commandersByFaction"` }
Battle represents an armed encounter between two or more commanders belonging to different factions that occurred at some point, somewhere in history
type CommandersByFaction ¶
CommandersByFaction is a map that indexes the IDs of commanders according to the faction to which they belong during a specific battle
type CommandersBySide ¶
type CommandersBySide struct { A []commanders.Commander `json:"a"` B []commanders.Commander `json:"b"` }
CommandersBySide groups all of the commanders that participated in a battle into the two opposing sides. These sides are A and B
type CreationInput ¶
type CreationInput struct { WikiID int `validate:"required"` URL string `validate:"required,url"` Name string `validate:"required"` PartOf string Summary string `validate:"required"` StartDate dates.Historic `validate:"required"` EndDate dates.Historic `validate:"required"` Location locations.Location Result string `validate:"required"` TerritorialChanges string Strength statistics.SideNumbers Casualties statistics.SideNumbers FactionsBySide IDsBySide CommandersBySide IDsBySide CommandersByFaction CommandersByFaction }
CreationInput is a struct that contains all of the data required to create a battle. This includes annotations required by validations
type FactionsBySide ¶
FactionsBySide groups all of the factions that participated in a battle into the two opposing sides. These sides are A and B
type FindManyQuery ¶
type FindManyQuery struct { FactionID uuid.UUID CommanderID uuid.UUID Name string Summary string Place string Result string FromDate dates.Historic ToDate dates.Historic }
FindManyQuery is used to refine the filters when finding many battles
type FindOneQuery ¶
FindOneQuery is used to refine the filters when finding one battle
type IDsBySide ¶
IDsBySide groups the IDs of the factions or commanders that participated in a battle into the two opposing sides. These sides are A and B
type Reader ¶
type Reader interface { FindOne(query FindOneQuery) (Battle, error) FindMany(query FindManyQuery, page int) ([]Battle, int, error) }
Reader is the interface through which battles may be read
type Repository ¶
Repository is the interface through which battles may be read and written