domain

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ListEnnoblementsParamsSortMinLength = 0
	ListEnnoblementsParamsSortMaxLength = 3
)
View Source
const (
	ListEnnoblementsParamsLimitMin = 1
	ListEnnoblementsParamsLimitMax = 500
)
View Source
const (
	PlayerNameMinLength = 1
	PlayerNameMaxLength = 150
)
View Source
const (
	ListPlayersParamsNamesMinLength = 0
	ListPlayersParamsNamesMaxLength = ListPlayersParamsLimitMax
)
View Source
const (
	ListPlayersParamsQMinLength = 3
	ListPlayersParamsQMaxLength = 255
)
View Source
const (
	ListPlayersParamsSortMinLength = 0
	ListPlayersParamsSortMaxLength = 4
)
View Source
const (
	ListPlayersParamsLimitMin = 1
	ListPlayersParamsLimitMax = 500
)
View Source
const (
	ListPlayerSnapshotsParamsSortMinLength = 0
	ListPlayerSnapshotsParamsSortMaxLength = 3
)
View Source
const (
	ListPlayerSnapshotsParamsLimitMin = 1
	ListPlayerSnapshotsParamsLimitMax = 500
)
View Source
const (
	ListServersParamsSortMinLength = 0
	ListServersParamsSortMaxLength = 2
)
View Source
const (
	ListServersParamsLimitMin = 1
	ListServersParamsLimitMax = 500
)
View Source
const (
	ListServerSnapshotsParamsSortMinLength = 0
	ListServerSnapshotsParamsSortMaxLength = 3
)
View Source
const (
	ListServerSnapshotsParamsLimitMin = 1
	ListServerSnapshotsParamsLimitMix = 500
)
View Source
const (
	TribeNameMinLength = 1
	TribeNameMaxLength = 255
	TribeTagMinLength  = 1
	TribeTagMaxLength  = 10
)
View Source
const (
	ListTribesParamsTagsMinLength = 0
	ListTribesParamsTagsMaxLength = ListTribesParamsLimitMax
)
View Source
const (
	ListTribesParamsQMinLength = 2
	ListTribesParamsQMaxLength = 255
)
View Source
const (
	ListTribesParamsSortMinLength = 0
	ListTribesParamsSortMaxLength = 4
)
View Source
const (
	ListTribesParamsLimitMin = 1
	ListTribesParamsLimitMax = 500
)
View Source
const (
	ListTribeChangesParamsSortMinLength = 0
	ListTribeChangesParamsSortMaxLength = 3
)
View Source
const (
	ListTribeChangesParamsLimitMin = 1
	ListTribeChangesParamsLimitMax = 500
)
View Source
const (
	ListTribeSnapshotsParamsSortMinLength = 0
	ListTribeSnapshotsParamsSortMaxLength = 3
)
View Source
const (
	ListTribeSnapshotsParamsLimitMin = 1
	ListTribeSnapshotsParamsLimitMax = 500
)
View Source
const (
	ListVersionsParamsSortMinLength = 0
	ListVersionsParamsSortMaxLength = 1
)
View Source
const (
	ListVersionsParamsLimitMin = 1
	ListVersionsParamsLimitMax = 500
)
View Source
const (
	VillageNameMinLength      = 1
	VillageNameMaxLength      = 150
	VillageContinentMinLength = 1
	VillageContinentMaxLength = 5
)
View Source
const (
	ListVillagesParamsCoordsMinLength = 0
	ListVillagesParamsCoordsMaxLength = ListVillagesParamsLimitMax
)
View Source
const (
	ListVillagesParamsSortMinLength = 0
	ListVillagesParamsSortMaxLength = 2
)
View Source
const (
	ListVillagesParamsLimitMin = 1
	ListVillagesParamsLimitMax = 500
)
View Source
const EnnoblementRetentionForClosedServers = 365 * 24 * time.Hour
View Source
const ModelNameBaseEnnoblement = "BaseEnnoblement"
View Source
const ModelNameBasePlayer = "BasePlayer"
View Source
const ModelNameBaseServer = "BaseServer"
View Source
const ModelNameBaseTribe = "BaseTribe"
View Source
const ModelNameBaseVillage = "BaseVillage"
View Source
const ModelNameCleanUpDataCmdPayload = "CleanUpDataCmdPayload"
View Source
const ModelNameCleanUpDataCmdPayloadServer = "CleanUpDataCmdPayloadServer"
View Source
const ModelNameCountPlayersParams = "CountPlayersParams"
View Source
const ModelNameCountTribesParams = "CountTribesParams"
View Source
const ModelNameCreateEnnoblementParams = "CreateEnnoblementParams"
View Source
const ModelNameCreatePlayerParams = "CreatePlayerParams"
View Source
const ModelNameCreateServerParams = "CreateServerParams"
View Source
const ModelNameCreateSnapshotsCmdPayload = "CreateSnapshotsCmdPayload"
View Source
const ModelNameCreateTribeChangeParams = "CreateTribeChangeParams"
View Source
const ModelNameCreateTribeParams = "CreateTribeParams"
View Source
const ModelNameCreateVillageParams = "CreateVillageParams"
View Source
const ModelNameEnnoblement = "Ennoblement"
View Source
const ModelNameEnnoblementCursor = "EnnoblementCursor"
View Source
const ModelNameEnnoblementsSyncedEventPayload = "EnnoblementsSyncedEventPayload"
View Source
const ModelNameListEnnoblementsParams = "ListEnnoblementsParams"
View Source
const ModelNameListEnnoblementsResult = "ListEnnoblementsResult"
View Source
const ModelNameListEnnoblementsWithRelationsResult = "ListEnnoblementsWithRelationsResult"
View Source
const ModelNameListPlayerSnapshotsParams = "ListPlayerSnapshotsParams"
View Source
const ModelNameListPlayerSnapshotsResult = "ListPlayerSnapshotsResult"
View Source
const ModelNameListPlayerSnapshotsWithRelationsResult = "ListPlayerSnapshotsWithRelationsResult"
View Source
const ModelNameListPlayersParams = "ListPlayersParams"
View Source
const ModelNameListPlayersResult = "ListPlayersResult"
View Source
const ModelNameListPlayersWithRelationsResult = "ListPlayersWithRelationsResult"
View Source
const ModelNameListServerSnapshotsParams = "ListServerSnapshotsParams"
View Source
const ModelNameListServerSnapshotsResult = "ListServerSnapshotsResult"
View Source
const ModelNameListServerSnapshotsWithRelationsResult = "ListServerSnapshotsWithRelationsResult"
View Source
const ModelNameListServersParams = "ListServersParams"
View Source
const ModelNameListServersResult = "ListServersResult"
View Source
const ModelNameListTribeChangesParams = "ListTribeChangesParams"
View Source
const ModelNameListTribeChangesResult = "ListTribeChangesResult"
View Source
const ModelNameListTribeChangesWithRelationsResult = "ListTribeChangesWithRelationsResult"
View Source
const ModelNameListTribeSnapshotsParams = "ListTribeSnapshotsParams"
View Source
const ModelNameListTribeSnapshotsResult = "ListTribeSnapshotsResult"
View Source
const ModelNameListTribeSnapshotsWithRelationsResult = "ListTribeSnapshotsWithRelationsResult"
View Source
const ModelNameListTribesParams = "ListTribesParams"
View Source
const ModelNameListTribesResult = "ListTribesResult"
View Source
const ModelNameListTribesWithRelationsResult = "ListTribesWithRelationsResult"
View Source
const ModelNameListVersionsParams = "ListVersionsParams"
View Source
const ModelNameListVersionsResult = "ListVersionsResult"
View Source
const ModelNameListVillagesParams = "ListVillagesParams"
View Source
const ModelNameListVillagesResult = "ListVillagesResult"
View Source
const ModelNameListVillagesWithRelationsResult = "ListVillagesWithRelationsResult"
View Source
const ModelNameOpponentsDefeated = "OpponentsDefeated"
View Source
const ModelNamePlayer = "Player"
View Source
const ModelNamePlayerCursor = "PlayerCursor"
View Source
const ModelNamePlayerMeta = "PlayerMeta"
View Source
const ModelNamePlayerSnapshot = "PlayerSnapshot"
View Source
const ModelNamePlayerSnapshotCursor = "PlayerSnapshotCursor"
View Source
const ModelNamePlayersSyncedEventPayload = "PlayersSyncedEventPayload"
View Source
const ModelNameServer = "Server"
View Source
const ModelNameServerCursor = "ServerCursor"
View Source
const ModelNameServerMap = "ServerMap"
View Source
const ModelNameServerMeta = "ServerMeta"
View Source
const ModelNameServerSnapshot = "ServerSnapshot"
View Source
const ModelNameServerSnapshotCursor = "ServerSnapshotCursor"
View Source
const ModelNameServerSyncedEventPayload = "ServerSyncedEventPayload"
View Source
const ModelNameSnapshotsCreatedEventPayload = "SnapshotsCreatedEventPayload"
View Source
const ModelNameSyncEnnoblementsCmdPayload = "SyncEnnoblementsCmdPayload"
View Source
const ModelNameSyncServersCmdPayload = "SyncServersCmdPayload"
View Source
const ModelNameTribe = "Tribe"
View Source
const ModelNameTribeChange = "TribeChange"
View Source
const ModelNameTribeChangeCursor = "TribeChangeCursor"
View Source
const ModelNameTribeCursor = "TribeCursor"
View Source
const ModelNameTribeMeta = "TribeMeta"
View Source
const ModelNameTribeSnapshot = "TribeSnapshot"
View Source
const ModelNameTribeSnapshotCursor = "TribeSnapshotCursor"
View Source
const ModelNameTribesSyncedEventPayload = "TribesSyncedEventPayload"
View Source
const ModelNameUpdateServerParams = "UpdateServerParams"
View Source
const ModelNameVersion = "Version"
View Source
const ModelNameVersionCursor = "VersionCursor"
View Source
const ModelNameVillage = "Village"
View Source
const ModelNameVillageCursor = "VillageCursor"
View Source
const ModelNameVillageMeta = "VillageMeta"
View Source
const ModelNameVillagesSyncedEventPayload = "VillagesSyncedEventPayload"
View Source
const PlayerSnapshotRetentionForClosedServers = 180 * 24 * time.Hour
View Source
const TribeSnapshotRetentionForClosedServers = 180 * 24 * time.Hour

Variables

View Source
var ErrInvalidCoordsString error = simpleError{
	// contains filtered or unexported fields
}
View Source
var ErrInvalidCursor error = simpleError{
	// contains filtered or unexported fields
}

ErrInvalidCursor is an error that is returned when a cursor can't be decoded (e.g. is malformed).

View Source
var ErrNil error = simpleError{
	// contains filtered or unexported fields
}
View Source
var ErrRequired error = simpleError{
	// contains filtered or unexported fields
}
View Source
var ErrTooManyLegendEntries error = simpleError{
	// contains filtered or unexported fields
}

Functions

This section is empty.

Types

type BaseEnnoblement

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

func NewBaseEnnoblement added in v1.0.0

func NewBaseEnnoblement(
	villageID int,
	newOwnerID int,
	newTribeID int,
	oldOwnerID int,
	oldTribeID int,
	points int,
	createdAt time.Time,
) (BaseEnnoblement, error)

func (BaseEnnoblement) CreatedAt

func (e BaseEnnoblement) CreatedAt() time.Time

func (BaseEnnoblement) IsZero added in v1.0.0

func (e BaseEnnoblement) IsZero() bool

func (BaseEnnoblement) NewOwnerID

func (e BaseEnnoblement) NewOwnerID() int

func (BaseEnnoblement) NewTribeID

func (e BaseEnnoblement) NewTribeID() int

func (BaseEnnoblement) OldOwnerID

func (e BaseEnnoblement) OldOwnerID() int

func (BaseEnnoblement) OldTribeID

func (e BaseEnnoblement) OldTribeID() int

func (BaseEnnoblement) Points

func (e BaseEnnoblement) Points() int

func (BaseEnnoblement) VillageID

func (e BaseEnnoblement) VillageID() int

type BaseEnnoblements added in v1.0.0

type BaseEnnoblements []BaseEnnoblement

type BasePlayer

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

func NewBasePlayer added in v1.0.0

func NewBasePlayer(
	id int,
	name string,
	numVillages int,
	points int,
	rank int,
	tribeID int,
	od OpponentsDefeated,
	profileURL *url.URL,
) (BasePlayer, error)

func (BasePlayer) ID

func (p BasePlayer) ID() int

func (BasePlayer) IsZero added in v1.0.0

func (p BasePlayer) IsZero() bool

func (BasePlayer) Name

func (p BasePlayer) Name() string

func (BasePlayer) NumVillages

func (p BasePlayer) NumVillages() int

func (BasePlayer) OD added in v1.0.0

func (BasePlayer) Points

func (p BasePlayer) Points() int

func (BasePlayer) ProfileURL added in v0.1.7

func (p BasePlayer) ProfileURL() *url.URL

func (BasePlayer) Rank

func (p BasePlayer) Rank() int

func (BasePlayer) TribeID

func (p BasePlayer) TribeID() int

type BasePlayers added in v1.0.0

type BasePlayers []BasePlayer

type BaseServer added in v1.0.0

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

func NewBaseServer added in v1.0.0

func NewBaseServer(key string, u *url.URL, open bool) (BaseServer, error)

func (BaseServer) IsZero added in v1.0.0

func (s BaseServer) IsZero() bool

func (BaseServer) Key added in v1.0.0

func (s BaseServer) Key() string

func (BaseServer) Open added in v1.0.0

func (s BaseServer) Open() bool

func (BaseServer) URL added in v1.0.0

func (s BaseServer) URL() *url.URL

type BaseServers added in v1.0.0

type BaseServers []BaseServer

func (BaseServers) FilterOutSpecial added in v1.0.0

func (ss BaseServers) FilterOutSpecial(specials Servers) BaseServers

type BaseTribe

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

func NewBaseTribe added in v1.0.0

func NewBaseTribe(
	id int,
	name string,
	tag string,
	numMembers int,
	numVillages int,
	points int,
	allPoints int,
	rank int,
	od OpponentsDefeated,
	profileURL *url.URL,
) (BaseTribe, error)

func (BaseTribe) AllPoints

func (t BaseTribe) AllPoints() int

func (BaseTribe) ID

func (t BaseTribe) ID() int

func (BaseTribe) IsZero added in v1.0.0

func (t BaseTribe) IsZero() bool

func (BaseTribe) Name

func (t BaseTribe) Name() string

func (BaseTribe) NumMembers

func (t BaseTribe) NumMembers() int

func (BaseTribe) NumVillages

func (t BaseTribe) NumVillages() int

func (BaseTribe) OD added in v1.0.0

func (BaseTribe) Points

func (t BaseTribe) Points() int

func (BaseTribe) ProfileURL added in v0.1.7

func (t BaseTribe) ProfileURL() *url.URL

func (BaseTribe) Rank

func (t BaseTribe) Rank() int

func (BaseTribe) Tag

func (t BaseTribe) Tag() string

type BaseTribes added in v1.0.0

type BaseTribes []BaseTribe

type BaseVillage

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

func NewBaseVillage added in v1.0.0

func NewBaseVillage(
	id int,
	name string,
	points int,
	x, y int,
	continent string,
	bonus int,
	playerID int,
	profileURL *url.URL,
) (BaseVillage, error)

func (BaseVillage) Bonus

func (v BaseVillage) Bonus() int

func (BaseVillage) Continent

func (v BaseVillage) Continent() string

func (BaseVillage) ID

func (v BaseVillage) ID() int

func (BaseVillage) IsZero added in v1.0.0

func (v BaseVillage) IsZero() bool

func (BaseVillage) Name

func (v BaseVillage) Name() string

func (BaseVillage) PlayerID

func (v BaseVillage) PlayerID() int

func (BaseVillage) Points

func (v BaseVillage) Points() int

func (BaseVillage) ProfileURL added in v0.1.7

func (v BaseVillage) ProfileURL() *url.URL

func (BaseVillage) X

func (v BaseVillage) X() int

func (BaseVillage) Y

func (v BaseVillage) Y() int

type BaseVillages added in v1.0.0

type BaseVillages []BaseVillage

type Building

type Building struct {
	BuildTime       float64
	BuildTimeFactor float64
	Iron            int
	IronFactor      float64
	MaxLevel        int
	MinLevel        int
	Pop             int
	PopFactor       float64
	Stone           int
	StoneFactor     float64
	Wood            int
	WoodFactor      float64
}

type BuildingInfo

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

func NewBuildingInfo added in v1.0.0

func NewBuildingInfo(
	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,
) (BuildingInfo, error)

func (BuildingInfo) Barracks

func (b BuildingInfo) Barracks() Building

func (BuildingInfo) Farm

func (b BuildingInfo) Farm() Building

func (BuildingInfo) Garage

func (b BuildingInfo) Garage() Building

func (BuildingInfo) Hide

func (b BuildingInfo) Hide() Building

func (BuildingInfo) Iron

func (b BuildingInfo) Iron() Building

func (BuildingInfo) Main

func (b BuildingInfo) Main() Building

func (BuildingInfo) Market

func (b BuildingInfo) Market() Building

func (BuildingInfo) Place

func (b BuildingInfo) Place() Building

func (BuildingInfo) Smith

func (b BuildingInfo) Smith() Building

func (BuildingInfo) Snob

func (b BuildingInfo) Snob() Building

func (BuildingInfo) Stable

func (b BuildingInfo) Stable() Building

func (BuildingInfo) Statue

func (b BuildingInfo) Statue() Building

func (BuildingInfo) Stone

func (b BuildingInfo) Stone() Building

func (BuildingInfo) Storage

func (b BuildingInfo) Storage() Building

func (BuildingInfo) Wall

func (b BuildingInfo) Wall() Building

func (BuildingInfo) Watchtower

func (b BuildingInfo) Watchtower() Building

func (BuildingInfo) Wood

func (b BuildingInfo) Wood() Building

type CleanUpDataCmdPayload added in v1.0.0

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

func NewCleanUpDataCmdPayload added in v1.0.0

func NewCleanUpDataCmdPayload(server CleanUpDataCmdPayloadServer) (CleanUpDataCmdPayload, error)

func (CleanUpDataCmdPayload) CanCleanUpEnnoblements added in v1.0.0

func (p CleanUpDataCmdPayload) CanCleanUpEnnoblements() bool

func (CleanUpDataCmdPayload) CanCleanUpPlayerSnapshots added in v1.0.0

func (p CleanUpDataCmdPayload) CanCleanUpPlayerSnapshots() bool

func (CleanUpDataCmdPayload) CanCleanUpTribeSnapshots added in v1.0.0

func (p CleanUpDataCmdPayload) CanCleanUpTribeSnapshots() bool

func (CleanUpDataCmdPayload) Server added in v1.0.0

type CleanUpDataCmdPayloadServer added in v1.0.0

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

func NewCleanUpDataCmdPayloadServer added in v1.0.0

func NewCleanUpDataCmdPayloadServer(
	key string,
	versionCode string,
	open bool,
	special bool,
	playerDataSyncedAt time.Time,
	playerSnapshotsCreatedAt time.Time,
	tribeDataSyncedAt time.Time,
	tribeSnapshotsCreatedAt time.Time,
	villageDataSyncedAt time.Time,
	ennoblementDataSyncedAt time.Time,
) (CleanUpDataCmdPayloadServer, error)

func (CleanUpDataCmdPayloadServer) EnnoblementDataSyncedAt added in v1.0.0

func (s CleanUpDataCmdPayloadServer) EnnoblementDataSyncedAt() time.Time

func (CleanUpDataCmdPayloadServer) IsZero added in v1.0.0

func (s CleanUpDataCmdPayloadServer) IsZero() bool

func (CleanUpDataCmdPayloadServer) Key added in v1.0.0

func (CleanUpDataCmdPayloadServer) Open added in v1.0.0

func (CleanUpDataCmdPayloadServer) PlayerDataSyncedAt added in v1.0.0

func (s CleanUpDataCmdPayloadServer) PlayerDataSyncedAt() time.Time

func (CleanUpDataCmdPayloadServer) PlayerSnapshotsCreatedAt added in v1.0.0

func (s CleanUpDataCmdPayloadServer) PlayerSnapshotsCreatedAt() time.Time

func (CleanUpDataCmdPayloadServer) Special added in v1.0.0

func (s CleanUpDataCmdPayloadServer) Special() bool

func (CleanUpDataCmdPayloadServer) TribeDataSyncedAt added in v1.0.0

func (s CleanUpDataCmdPayloadServer) TribeDataSyncedAt() time.Time

func (CleanUpDataCmdPayloadServer) TribeSnapshotsCreatedAt added in v1.0.0

func (s CleanUpDataCmdPayloadServer) TribeSnapshotsCreatedAt() time.Time

func (CleanUpDataCmdPayloadServer) VersionCode added in v1.0.0

func (s CleanUpDataCmdPayloadServer) VersionCode() string

func (CleanUpDataCmdPayloadServer) VillageDataSyncedAt added in v1.0.0

func (s CleanUpDataCmdPayloadServer) VillageDataSyncedAt() time.Time

type Coords added in v0.12.3

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

func (Coords) String added in v1.0.0

func (c Coords) String() string

func (Coords) X added in v0.12.3

func (c Coords) X() int

func (Coords) Y added in v0.12.3

func (c Coords) Y() int

type CountPlayersParams added in v1.1.0

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

func NewCountPlayersParams added in v1.1.0

func NewCountPlayersParams() CountPlayersParams

func (*CountPlayersParams) ServerKeys added in v1.1.0

func (params *CountPlayersParams) ServerKeys() []string

func (*CountPlayersParams) SetServerKeys added in v1.1.0

func (params *CountPlayersParams) SetServerKeys(serverKeys []string) error

type CountTribesParams added in v1.1.0

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

func NewCountTribesParams added in v1.1.0

func NewCountTribesParams() CountTribesParams

func (*CountTribesParams) ServerKeys added in v1.1.0

func (params *CountTribesParams) ServerKeys() []string

func (*CountTribesParams) SetServerKeys added in v1.1.0

func (params *CountTribesParams) SetServerKeys(serverKeys []string) error

type CreateEnnoblementParams

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

func NewCreateEnnoblementParams added in v1.0.0

func NewCreateEnnoblementParams(serverKey string, ennoblements BaseEnnoblements) ([]CreateEnnoblementParams, error)

func (CreateEnnoblementParams) Base added in v1.0.0

func (CreateEnnoblementParams) ServerKey

func (params CreateEnnoblementParams) ServerKey() string

type CreatePlayerParams

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

func NewCreatePlayerParams added in v1.0.0

func NewCreatePlayerParams(serverKey string, players BasePlayers, storedPlayers Players) ([]CreatePlayerParams, error)

NewCreatePlayerParams constructs a slice of CreatePlayerParams based on the given parameters. Both slices must be sorted in ascending order by ID + if storedPlayers contains players from different servers. they must be sorted in ascending order by server key.

func (CreatePlayerParams) Base added in v1.0.0

func (params CreatePlayerParams) Base() BasePlayer

func (CreatePlayerParams) BestRank added in v0.4.5

func (params CreatePlayerParams) BestRank() int

func (CreatePlayerParams) BestRankAt added in v0.4.5

func (params CreatePlayerParams) BestRankAt() time.Time

func (CreatePlayerParams) LastActivityAt added in v0.4.5

func (params CreatePlayerParams) LastActivityAt() time.Time

func (CreatePlayerParams) MostPoints added in v0.4.5

func (params CreatePlayerParams) MostPoints() int

func (CreatePlayerParams) MostPointsAt added in v0.4.5

func (params CreatePlayerParams) MostPointsAt() time.Time

func (CreatePlayerParams) MostVillages added in v0.4.5

func (params CreatePlayerParams) MostVillages() int

func (CreatePlayerParams) MostVillagesAt added in v0.4.5

func (params CreatePlayerParams) MostVillagesAt() time.Time

func (CreatePlayerParams) ServerKey

func (params CreatePlayerParams) ServerKey() string

type CreatePlayerSnapshotParams added in v0.3.0

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

func NewCreatePlayerSnapshotParams added in v1.0.0

func NewCreatePlayerSnapshotParams(players Players, date time.Time) ([]CreatePlayerSnapshotParams, error)

func (CreatePlayerSnapshotParams) Date added in v0.3.0

func (params CreatePlayerSnapshotParams) Date() time.Time

func (CreatePlayerSnapshotParams) NumVillages added in v0.3.0

func (params CreatePlayerSnapshotParams) NumVillages() int

func (CreatePlayerSnapshotParams) OD added in v1.0.0

func (CreatePlayerSnapshotParams) PlayerID added in v0.3.0

func (params CreatePlayerSnapshotParams) PlayerID() int

func (CreatePlayerSnapshotParams) Points added in v0.3.0

func (params CreatePlayerSnapshotParams) Points() int

func (CreatePlayerSnapshotParams) Rank added in v0.3.0

func (params CreatePlayerSnapshotParams) Rank() int

func (CreatePlayerSnapshotParams) ServerKey added in v0.3.0

func (params CreatePlayerSnapshotParams) ServerKey() string

func (CreatePlayerSnapshotParams) TribeID added in v0.3.0

func (params CreatePlayerSnapshotParams) TribeID() int

type CreateServerParams

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

func NewCreateServerParams added in v1.0.0

func NewCreateServerParams(servers BaseServers, versionCode string) ([]CreateServerParams, error)

func (CreateServerParams) Base added in v1.0.0

func (params CreateServerParams) Base() BaseServer

func (CreateServerParams) VersionCode

func (params CreateServerParams) VersionCode() string

type CreateServerSnapshotParams added in v1.1.0

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

func NewCreateServerSnapshotParams added in v1.1.0

func NewCreateServerSnapshotParams(server Server, date time.Time) (CreateServerSnapshotParams, error)

func (CreateServerSnapshotParams) Date added in v1.1.0

func (params CreateServerSnapshotParams) Date() time.Time

func (CreateServerSnapshotParams) NumActivePlayers added in v1.1.0

func (params CreateServerSnapshotParams) NumActivePlayers() int

func (CreateServerSnapshotParams) NumActiveTribes added in v1.1.0

func (params CreateServerSnapshotParams) NumActiveTribes() int

func (CreateServerSnapshotParams) NumBarbarianVillages added in v1.1.0

func (params CreateServerSnapshotParams) NumBarbarianVillages() int

func (CreateServerSnapshotParams) NumBonusVillages added in v1.1.0

func (params CreateServerSnapshotParams) NumBonusVillages() int

func (CreateServerSnapshotParams) NumInactivePlayers added in v1.1.0

func (params CreateServerSnapshotParams) NumInactivePlayers() int

func (CreateServerSnapshotParams) NumInactiveTribes added in v1.1.0

func (params CreateServerSnapshotParams) NumInactiveTribes() int

func (CreateServerSnapshotParams) NumPlayerVillages added in v1.1.0

func (params CreateServerSnapshotParams) NumPlayerVillages() int

func (CreateServerSnapshotParams) NumPlayers added in v1.1.0

func (params CreateServerSnapshotParams) NumPlayers() int

func (CreateServerSnapshotParams) NumTribes added in v1.1.0

func (params CreateServerSnapshotParams) NumTribes() int

func (CreateServerSnapshotParams) NumVillages added in v1.1.0

func (params CreateServerSnapshotParams) NumVillages() int

func (CreateServerSnapshotParams) ServerKey added in v1.1.0

func (params CreateServerSnapshotParams) ServerKey() string

type CreateSnapshotsCmdPayload added in v0.3.0

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

func NewCreateSnapshotsCmdPayload added in v1.0.0

func NewCreateSnapshotsCmdPayload(
	serverKey string,
	versionCode string,
	versionTimezone string,
	date time.Time,
) (CreateSnapshotsCmdPayload, error)

func (CreateSnapshotsCmdPayload) Date added in v0.3.0

func (CreateSnapshotsCmdPayload) ServerKey added in v1.0.0

func (p CreateSnapshotsCmdPayload) ServerKey() string

func (CreateSnapshotsCmdPayload) VersionCode added in v0.3.0

func (p CreateSnapshotsCmdPayload) VersionCode() string

func (CreateSnapshotsCmdPayload) VersionTimezone added in v1.0.0

func (p CreateSnapshotsCmdPayload) VersionTimezone() string

type CreateTribeChangeParams added in v0.4.0

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

func NewCreateTribeChangeParams added in v1.0.0

func NewCreateTribeChangeParams(
	serverKey string,
	playerID int,
	oldTribeID int,
	newTribeID int,
) (CreateTribeChangeParams, error)

func NewCreateTribeChangeParamsFromPlayers added in v1.0.0

func NewCreateTribeChangeParamsFromPlayers(
	serverKey string,
	players BasePlayers,
	storedPlayers Players,
) ([]CreateTribeChangeParams, error)

NewCreateTribeChangeParamsFromPlayers constructs a slice of CreatePlayerParams based on the given parameters. Both slices must be sorted in ascending order by ID + if storedPlayers contains players from different servers. they must be sorted in ascending order by server key.

func (CreateTribeChangeParams) NewTribeID added in v0.4.0

func (params CreateTribeChangeParams) NewTribeID() int

func (CreateTribeChangeParams) OldTribeID added in v0.4.0

func (params CreateTribeChangeParams) OldTribeID() int

func (CreateTribeChangeParams) PlayerID added in v0.4.0

func (params CreateTribeChangeParams) PlayerID() int

func (CreateTribeChangeParams) ServerKey added in v0.4.0

func (params CreateTribeChangeParams) ServerKey() string

type CreateTribeParams

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

func NewCreateTribeParams added in v1.0.0

func NewCreateTribeParams(serverKey string, tribes BaseTribes, storedTribes Tribes) ([]CreateTribeParams, error)

NewCreateTribeParams constructs a slice of CreateTribeParams based on the given parameters. Both slices must be sorted in ascending order by ID + if storedTribes contains tribes from different servers. they must be sorted in ascending order by server key.

func (CreateTribeParams) Base added in v1.0.0

func (params CreateTribeParams) Base() BaseTribe

func (CreateTribeParams) BestRank added in v0.4.5

func (params CreateTribeParams) BestRank() int

func (CreateTribeParams) BestRankAt added in v0.4.5

func (params CreateTribeParams) BestRankAt() time.Time

func (CreateTribeParams) MostPoints added in v0.4.5

func (params CreateTribeParams) MostPoints() int

func (CreateTribeParams) MostPointsAt added in v0.4.5

func (params CreateTribeParams) MostPointsAt() time.Time

func (CreateTribeParams) MostVillages added in v0.4.5

func (params CreateTribeParams) MostVillages() int

func (CreateTribeParams) MostVillagesAt added in v0.4.5

func (params CreateTribeParams) MostVillagesAt() time.Time

func (CreateTribeParams) ServerKey

func (params CreateTribeParams) ServerKey() string

type CreateTribeSnapshotParams added in v0.3.0

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

func NewCreateTribeSnapshotParams added in v1.0.0

func NewCreateTribeSnapshotParams(tribes Tribes, date time.Time) ([]CreateTribeSnapshotParams, error)

func (CreateTribeSnapshotParams) AllPoints added in v0.3.0

func (params CreateTribeSnapshotParams) AllPoints() int

func (CreateTribeSnapshotParams) Date added in v0.3.0

func (params CreateTribeSnapshotParams) Date() time.Time

func (CreateTribeSnapshotParams) Dominance added in v0.3.0

func (params CreateTribeSnapshotParams) Dominance() float64

func (CreateTribeSnapshotParams) NumMembers added in v0.3.0

func (params CreateTribeSnapshotParams) NumMembers() int

func (CreateTribeSnapshotParams) NumVillages added in v0.3.0

func (params CreateTribeSnapshotParams) NumVillages() int

func (CreateTribeSnapshotParams) OD added in v1.0.0

func (CreateTribeSnapshotParams) Points added in v0.3.0

func (params CreateTribeSnapshotParams) Points() int

func (CreateTribeSnapshotParams) Rank added in v0.3.0

func (params CreateTribeSnapshotParams) Rank() int

func (CreateTribeSnapshotParams) ServerKey added in v0.3.0

func (params CreateTribeSnapshotParams) ServerKey() string

func (CreateTribeSnapshotParams) TribeID added in v0.3.0

func (params CreateTribeSnapshotParams) TribeID() int

type CreateVillageParams

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

func NewCreateVillageParams added in v1.0.0

func NewCreateVillageParams(serverKey string, villages BaseVillages) ([]CreateVillageParams, error)

func (CreateVillageParams) Base added in v1.0.0

func (params CreateVillageParams) Base() BaseVillage

func (CreateVillageParams) ServerKey

func (params CreateVillageParams) ServerKey() string

type Ennoblement

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

func UnmarshalEnnoblementFromDatabase added in v1.0.0

func UnmarshalEnnoblementFromDatabase(
	id int,
	serverKey string,
	villageID int,
	newOwnerID int,
	newTribeID int,
	oldOwnerID int,
	oldTribeID int,
	points int,
	createdAt time.Time,
) (Ennoblement, error)

UnmarshalEnnoblementFromDatabase unmarshals Ennoblement from the database.

It should be used only for unmarshalling from the database! You can't use UnmarshalEnnoblementFromDatabase as constructor - It may put domain into the invalid state!

func (Ennoblement) Base added in v1.0.0

func (e Ennoblement) Base() BaseEnnoblement

func (Ennoblement) CreatedAt added in v0.2.0

func (e Ennoblement) CreatedAt() time.Time

func (Ennoblement) ID

func (e Ennoblement) ID() int

func (Ennoblement) IsZero added in v1.0.0

func (e Ennoblement) IsZero() bool

func (Ennoblement) NewOwnerID added in v0.2.0

func (e Ennoblement) NewOwnerID() int

func (Ennoblement) NewTribeID added in v0.2.0

func (e Ennoblement) NewTribeID() int

func (Ennoblement) OldOwnerID added in v0.2.0

func (e Ennoblement) OldOwnerID() int

func (Ennoblement) OldTribeID added in v0.2.0

func (e Ennoblement) OldTribeID() int

func (Ennoblement) Points added in v0.2.0

func (e Ennoblement) Points() int

func (Ennoblement) ServerKey

func (e Ennoblement) ServerKey() string

func (Ennoblement) ToCursor added in v1.0.0

func (e Ennoblement) ToCursor() (EnnoblementCursor, error)

func (Ennoblement) VillageID added in v0.2.0

func (e Ennoblement) VillageID() int

func (Ennoblement) WithRelations added in v1.0.0

func (e Ennoblement) WithRelations(
	village VillageMeta,
	newOwner PlayerMeta,
	newTribe NullTribeMeta,
	oldOwner NullPlayerMeta,
	oldTribe NullTribeMeta,
) EnnoblementWithRelations

type EnnoblementCursor added in v1.0.0

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

func NewEnnoblementCursor added in v1.0.0

func NewEnnoblementCursor(id int, serverKey string, createdAt time.Time) (EnnoblementCursor, error)

func (EnnoblementCursor) CreatedAt added in v1.0.0

func (ec EnnoblementCursor) CreatedAt() time.Time

func (EnnoblementCursor) Encode added in v1.0.0

func (ec EnnoblementCursor) Encode() string

func (EnnoblementCursor) ID added in v1.0.0

func (ec EnnoblementCursor) ID() int

func (EnnoblementCursor) IsZero added in v1.0.0

func (ec EnnoblementCursor) IsZero() bool

func (EnnoblementCursor) ServerKey added in v1.0.0

func (ec EnnoblementCursor) ServerKey() string

type EnnoblementSort

type EnnoblementSort uint8
const (
	EnnoblementSortCreatedAtASC EnnoblementSort = iota + 1
	EnnoblementSortCreatedAtDESC
	EnnoblementSortIDASC
	EnnoblementSortIDDESC
	EnnoblementSortServerKeyASC
	EnnoblementSortServerKeyDESC
)

func (EnnoblementSort) IsInConflict added in v1.0.0

func (s EnnoblementSort) IsInConflict(s2 EnnoblementSort) bool

IsInConflict returns true if two sorts can't be used together (e.g. EnnoblementSortIDASC and EnnoblementSortIDDESC).

func (EnnoblementSort) String added in v1.0.0

func (s EnnoblementSort) String() string

type EnnoblementWithRelations added in v0.2.0

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

func (EnnoblementWithRelations) Ennoblement added in v1.0.0

func (e EnnoblementWithRelations) Ennoblement() Ennoblement

func (EnnoblementWithRelations) IsZero added in v1.0.0

func (e EnnoblementWithRelations) IsZero() bool

func (EnnoblementWithRelations) NewOwner added in v0.2.0

func (e EnnoblementWithRelations) NewOwner() PlayerMeta

func (EnnoblementWithRelations) NewTribe added in v0.2.0

func (EnnoblementWithRelations) OldOwner added in v0.2.0

func (EnnoblementWithRelations) OldTribe added in v0.2.0

func (EnnoblementWithRelations) Village added in v0.2.0

type Ennoblements added in v1.0.0

type Ennoblements []Ennoblement

type EnnoblementsSyncedEventPayload added in v1.0.0

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

func NewEnnoblementsSyncedEventPayload added in v1.0.0

func NewEnnoblementsSyncedEventPayload(
	serverKey string,
	serverURL *url.URL,
	versionCode string,
) (EnnoblementsSyncedEventPayload, error)

func (EnnoblementsSyncedEventPayload) ServerKey added in v1.0.0

func (p EnnoblementsSyncedEventPayload) ServerKey() string

func (EnnoblementsSyncedEventPayload) ServerURL added in v1.0.0

func (p EnnoblementsSyncedEventPayload) ServerURL() *url.URL

func (EnnoblementsSyncedEventPayload) VersionCode added in v1.0.0

func (p EnnoblementsSyncedEventPayload) VersionCode() string

type EnnoblementsWithRelations added in v1.0.0

type EnnoblementsWithRelations []EnnoblementWithRelations

type Error added in v0.6.6

type Error interface {
	error
	Type() ErrorType
	Code() string
}

type ErrorPathSegment added in v1.0.0

type ErrorPathSegment struct {
	Model string
	Field string
	Index int // Index may be <0 and this means that it is unset
}

func (ErrorPathSegment) String added in v1.0.0

func (s ErrorPathSegment) String() string

type ErrorType added in v1.0.0

type ErrorType uint8
const (
	ErrorTypeUnknown ErrorType = iota
	ErrorTypeNotFound
	ErrorTypeIncorrectInput
)

func (ErrorType) String added in v1.0.0

func (e ErrorType) String() string

type ErrorWithParams added in v1.0.0

type ErrorWithParams interface {
	Error
	Params() map[string]any
}

type ErrorWithPath added in v1.0.0

type ErrorWithPath interface {
	Error
	Path() ErrorPathSegment
}

type InvalidURLError added in v1.0.0

type InvalidURLError struct {
	URL string
}

func (InvalidURLError) Code added in v1.0.0

func (e InvalidURLError) Code() string

func (InvalidURLError) Error added in v1.0.0

func (e InvalidURLError) Error() string

func (InvalidURLError) Params added in v1.0.0

func (e InvalidURLError) Params() map[string]any

func (InvalidURLError) Type added in v1.0.0

func (e InvalidURLError) Type() ErrorType

type LenOutOfRangeError added in v1.0.0

type LenOutOfRangeError struct {
	Min     int
	Max     int
	Current int
}

func (LenOutOfRangeError) Code added in v1.0.0

func (e LenOutOfRangeError) Code() string

func (LenOutOfRangeError) Error added in v1.0.0

func (e LenOutOfRangeError) Error() string

func (LenOutOfRangeError) Params added in v1.0.0

func (e LenOutOfRangeError) Params() map[string]any

func (LenOutOfRangeError) Type added in v1.0.0

func (e LenOutOfRangeError) Type() ErrorType

type ListEnnoblementsParams

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

func NewListEnnoblementsParams added in v1.0.0

func NewListEnnoblementsParams() ListEnnoblementsParams

func (*ListEnnoblementsParams) Before added in v1.0.0

func (params *ListEnnoblementsParams) Before() NullTime

func (*ListEnnoblementsParams) Cursor added in v1.0.0

func (params *ListEnnoblementsParams) Cursor() EnnoblementCursor

func (*ListEnnoblementsParams) Limit added in v1.0.0

func (params *ListEnnoblementsParams) Limit() int

func (*ListEnnoblementsParams) PlayerIDs added in v1.0.0

func (params *ListEnnoblementsParams) PlayerIDs() []int

func (*ListEnnoblementsParams) PrependSort added in v1.0.0

func (params *ListEnnoblementsParams) PrependSort(sort []EnnoblementSort) error

func (*ListEnnoblementsParams) PrependSortString added in v1.0.0

func (params *ListEnnoblementsParams) PrependSortString(sort []string, allowed []EnnoblementSort, maxLength int) error

func (*ListEnnoblementsParams) ServerKeys

func (params *ListEnnoblementsParams) ServerKeys() []string

func (*ListEnnoblementsParams) SetBefore added in v1.0.0

func (params *ListEnnoblementsParams) SetBefore(before NullTime) error

func (*ListEnnoblementsParams) SetCursor added in v1.0.0

func (params *ListEnnoblementsParams) SetCursor(cursor EnnoblementCursor) error

func (*ListEnnoblementsParams) SetEncodedCursor added in v1.0.0

func (params *ListEnnoblementsParams) SetEncodedCursor(encoded string) error

func (*ListEnnoblementsParams) SetLimit added in v1.0.0

func (params *ListEnnoblementsParams) SetLimit(limit int) error

func (*ListEnnoblementsParams) SetPlayerIDs added in v1.0.0

func (params *ListEnnoblementsParams) SetPlayerIDs(playerIDs []int) error

func (*ListEnnoblementsParams) SetServerKeys added in v1.0.0

func (params *ListEnnoblementsParams) SetServerKeys(serverKeys []string) error

func (*ListEnnoblementsParams) SetSince added in v1.0.0

func (params *ListEnnoblementsParams) SetSince(since NullTime) error

func (*ListEnnoblementsParams) SetSort added in v1.0.0

func (params *ListEnnoblementsParams) SetSort(sort []EnnoblementSort) error

func (*ListEnnoblementsParams) SetTribeIDs added in v1.0.0

func (params *ListEnnoblementsParams) SetTribeIDs(tribeIDs []int) error

func (*ListEnnoblementsParams) SetVillageIDs added in v1.0.0

func (params *ListEnnoblementsParams) SetVillageIDs(villageIDs []int) error

func (*ListEnnoblementsParams) Since added in v1.0.0

func (params *ListEnnoblementsParams) Since() NullTime

func (*ListEnnoblementsParams) Sort

func (params *ListEnnoblementsParams) Sort() []EnnoblementSort

func (*ListEnnoblementsParams) TribeIDs added in v1.0.0

func (params *ListEnnoblementsParams) TribeIDs() []int

func (*ListEnnoblementsParams) VillageIDs added in v1.0.0

func (params *ListEnnoblementsParams) VillageIDs() []int

type ListEnnoblementsResult added in v1.0.0

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

func NewListEnnoblementsResult added in v1.0.0

func NewListEnnoblementsResult(ennoblements Ennoblements, next Ennoblement) (ListEnnoblementsResult, error)

func (ListEnnoblementsResult) Ennoblements added in v1.0.0

func (res ListEnnoblementsResult) Ennoblements() Ennoblements

func (ListEnnoblementsResult) Next added in v1.0.0

func (ListEnnoblementsResult) Self added in v1.0.0

type ListEnnoblementsWithRelationsResult added in v1.0.0

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

func NewListEnnoblementsWithRelationsResult added in v1.0.0

func NewListEnnoblementsWithRelationsResult(
	ennoblements EnnoblementsWithRelations,
	next EnnoblementWithRelations,
) (ListEnnoblementsWithRelationsResult, error)

func (ListEnnoblementsWithRelationsResult) Ennoblements added in v1.0.0

func (ListEnnoblementsWithRelationsResult) Next added in v1.0.0

func (ListEnnoblementsWithRelationsResult) Self added in v1.0.0

type ListPlayerSnapshotsParams added in v0.6.0

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

func NewListPlayerSnapshotsParams added in v1.0.0

func NewListPlayerSnapshotsParams() ListPlayerSnapshotsParams

func (*ListPlayerSnapshotsParams) Cursor added in v1.0.0

func (*ListPlayerSnapshotsParams) Limit added in v1.0.0

func (params *ListPlayerSnapshotsParams) Limit() int

func (*ListPlayerSnapshotsParams) PlayerIDs added in v0.7.0

func (params *ListPlayerSnapshotsParams) PlayerIDs() []int

func (*ListPlayerSnapshotsParams) PrependSort added in v1.0.0

func (params *ListPlayerSnapshotsParams) PrependSort(sort []PlayerSnapshotSort) error

func (*ListPlayerSnapshotsParams) PrependSortString added in v1.0.0

func (params *ListPlayerSnapshotsParams) PrependSortString(
	sort []string,
	allowed []PlayerSnapshotSort,
	maxLength int,
) error

func (*ListPlayerSnapshotsParams) ServerKeys added in v0.6.0

func (params *ListPlayerSnapshotsParams) ServerKeys() []string

func (*ListPlayerSnapshotsParams) SetCursor added in v1.0.0

func (params *ListPlayerSnapshotsParams) SetCursor(cursor PlayerSnapshotCursor) error

func (*ListPlayerSnapshotsParams) SetEncodedCursor added in v1.0.0

func (params *ListPlayerSnapshotsParams) SetEncodedCursor(encoded string) error

func (*ListPlayerSnapshotsParams) SetLimit added in v1.0.0

func (params *ListPlayerSnapshotsParams) SetLimit(limit int) error

func (*ListPlayerSnapshotsParams) SetPlayerIDs added in v1.0.0

func (params *ListPlayerSnapshotsParams) SetPlayerIDs(playerIDs []int) error

func (*ListPlayerSnapshotsParams) SetServerKeys added in v1.0.0

func (params *ListPlayerSnapshotsParams) SetServerKeys(serverKeys []string) error

func (*ListPlayerSnapshotsParams) SetSort added in v1.0.0

func (params *ListPlayerSnapshotsParams) SetSort(sort []PlayerSnapshotSort) error

func (*ListPlayerSnapshotsParams) Sort added in v0.7.0

type ListPlayerSnapshotsResult added in v1.0.0

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

func NewListPlayerSnapshotsResult added in v1.0.0

func NewListPlayerSnapshotsResult(
	snapshots PlayerSnapshots,
	next PlayerSnapshot,
) (ListPlayerSnapshotsResult, error)

func (ListPlayerSnapshotsResult) Next added in v1.0.0

func (ListPlayerSnapshotsResult) PlayerSnapshots added in v1.0.0

func (res ListPlayerSnapshotsResult) PlayerSnapshots() PlayerSnapshots

func (ListPlayerSnapshotsResult) Self added in v1.0.0

type ListPlayerSnapshotsWithRelationsResult added in v1.0.0

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

func NewListPlayerSnapshotsWithRelationsResult added in v1.0.0

func NewListPlayerSnapshotsWithRelationsResult(
	snapshots PlayerSnapshotsWithRelations,
	next PlayerSnapshotWithRelations,
) (ListPlayerSnapshotsWithRelationsResult, error)

func (ListPlayerSnapshotsWithRelationsResult) Next added in v1.0.0

func (ListPlayerSnapshotsWithRelationsResult) PlayerSnapshots added in v1.0.0

func (ListPlayerSnapshotsWithRelationsResult) Self added in v1.0.0

type ListPlayersParams

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

func NewListPlayersParams added in v1.0.0

func NewListPlayersParams() ListPlayersParams

func (*ListPlayersParams) Cursor added in v1.0.0

func (params *ListPlayersParams) Cursor() PlayerCursor

func (*ListPlayersParams) Deleted

func (params *ListPlayersParams) Deleted() NullBool

func (*ListPlayersParams) IDs

func (params *ListPlayersParams) IDs() []int

func (*ListPlayersParams) Limit added in v1.0.0

func (params *ListPlayersParams) Limit() int

func (*ListPlayersParams) Names added in v0.12.4

func (params *ListPlayersParams) Names() []string

func (*ListPlayersParams) PrependSort added in v1.0.0

func (params *ListPlayersParams) PrependSort(sort []PlayerSort) error

func (*ListPlayersParams) PrependSortString added in v1.0.0

func (params *ListPlayersParams) PrependSortString(sort []string, allowed []PlayerSort, maxLength int) error

func (*ListPlayersParams) Q added in v1.5.0

func (params *ListPlayersParams) Q() NullString

func (*ListPlayersParams) ServerKeys

func (params *ListPlayersParams) ServerKeys() []string

func (*ListPlayersParams) SetCursor added in v1.0.0

func (params *ListPlayersParams) SetCursor(cursor PlayerCursor) error

func (*ListPlayersParams) SetDeleted added in v1.0.0

func (params *ListPlayersParams) SetDeleted(deleted NullBool) error

func (*ListPlayersParams) SetEncodedCursor added in v1.0.0

func (params *ListPlayersParams) SetEncodedCursor(encoded string) error

func (*ListPlayersParams) SetIDs added in v1.0.0

func (params *ListPlayersParams) SetIDs(ids []int) error

func (*ListPlayersParams) SetLimit added in v1.0.0

func (params *ListPlayersParams) SetLimit(limit int) error

func (*ListPlayersParams) SetNames added in v1.0.0

func (params *ListPlayersParams) SetNames(names []string) error

func (*ListPlayersParams) SetQ added in v1.5.0

func (params *ListPlayersParams) SetQ(q NullString) error

func (*ListPlayersParams) SetServerKeys added in v1.0.0

func (params *ListPlayersParams) SetServerKeys(serverKeys []string) error

func (*ListPlayersParams) SetSort added in v1.0.0

func (params *ListPlayersParams) SetSort(sort []PlayerSort) error

func (*ListPlayersParams) SetTribeIDs added in v1.0.0

func (params *ListPlayersParams) SetTribeIDs(tribeIDs []int) error

func (*ListPlayersParams) SetVersionCodes added in v1.0.0

func (params *ListPlayersParams) SetVersionCodes(versionCodes []string) error

func (*ListPlayersParams) Sort

func (params *ListPlayersParams) Sort() []PlayerSort

func (*ListPlayersParams) TribeIDs added in v1.0.0

func (params *ListPlayersParams) TribeIDs() []int

func (*ListPlayersParams) VersionCodes added in v0.8.3

func (params *ListPlayersParams) VersionCodes() []string

type ListPlayersResult added in v1.0.0

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

func NewListPlayersResult added in v1.0.0

func NewListPlayersResult(players Players, next Player) (ListPlayersResult, error)

func (ListPlayersResult) Next added in v1.0.0

func (res ListPlayersResult) Next() PlayerCursor

func (ListPlayersResult) Players added in v1.0.0

func (res ListPlayersResult) Players() Players

func (ListPlayersResult) Self added in v1.0.0

func (res ListPlayersResult) Self() PlayerCursor

type ListPlayersWithRelationsResult added in v1.0.0

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

func NewListPlayersWithRelationsResult added in v1.0.0

func NewListPlayersWithRelationsResult(
	players PlayersWithRelations,
	next PlayerWithRelations,
) (ListPlayersWithRelationsResult, error)

func (ListPlayersWithRelationsResult) Next added in v1.0.0

func (ListPlayersWithRelationsResult) Players added in v1.0.0

func (ListPlayersWithRelationsResult) Self added in v1.0.0

type ListServerSnapshotsParams added in v1.1.0

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

func NewListServerSnapshotsParams added in v1.1.0

func NewListServerSnapshotsParams() ListServerSnapshotsParams

func (*ListServerSnapshotsParams) Cursor added in v1.1.0

func (*ListServerSnapshotsParams) Limit added in v1.1.0

func (params *ListServerSnapshotsParams) Limit() int

func (*ListServerSnapshotsParams) PrependSort added in v1.1.0

func (params *ListServerSnapshotsParams) PrependSort(sort []ServerSnapshotSort) error

func (*ListServerSnapshotsParams) PrependSortString added in v1.1.0

func (params *ListServerSnapshotsParams) PrependSortString(
	sort []string,
	allowed []ServerSnapshotSort,
	maxLength int,
) error

func (*ListServerSnapshotsParams) ServerKeys added in v1.1.0

func (params *ListServerSnapshotsParams) ServerKeys() []string

func (*ListServerSnapshotsParams) SetCursor added in v1.1.0

func (params *ListServerSnapshotsParams) SetCursor(cursor ServerSnapshotCursor) error

func (*ListServerSnapshotsParams) SetEncodedCursor added in v1.1.0

func (params *ListServerSnapshotsParams) SetEncodedCursor(encoded string) error

func (*ListServerSnapshotsParams) SetLimit added in v1.1.0

func (params *ListServerSnapshotsParams) SetLimit(limit int) error

func (*ListServerSnapshotsParams) SetServerKeys added in v1.1.0

func (params *ListServerSnapshotsParams) SetServerKeys(serverKeys []string) error

func (*ListServerSnapshotsParams) SetSort added in v1.1.0

func (params *ListServerSnapshotsParams) SetSort(sort []ServerSnapshotSort) error

func (*ListServerSnapshotsParams) Sort added in v1.1.0

type ListServerSnapshotsResult added in v1.1.0

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

func NewListServerSnapshotsResult added in v1.1.0

func NewListServerSnapshotsResult(
	snapshots ServerSnapshots,
	next ServerSnapshot,
) (ListServerSnapshotsResult, error)

func (ListServerSnapshotsResult) Next added in v1.1.0

func (ListServerSnapshotsResult) Self added in v1.1.0

func (ListServerSnapshotsResult) ServerSnapshots added in v1.1.0

func (res ListServerSnapshotsResult) ServerSnapshots() ServerSnapshots

type ListServerSnapshotsWithRelationsResult added in v1.3.0

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

func NewListServerSnapshotsWithRelationsResult added in v1.3.0

func NewListServerSnapshotsWithRelationsResult(
	snapshots ServerSnapshotsWithRelations,
	next ServerSnapshotWithRelations,
) (ListServerSnapshotsWithRelationsResult, error)

func (ListServerSnapshotsWithRelationsResult) Next added in v1.3.0

func (ListServerSnapshotsWithRelationsResult) Self added in v1.3.0

func (ListServerSnapshotsWithRelationsResult) ServerSnapshots added in v1.3.0

type ListServersParams

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

func NewListServersParams added in v1.0.0

func NewListServersParams() ListServersParams

func (*ListServersParams) Cursor added in v1.0.0

func (params *ListServersParams) Cursor() ServerCursor

func (*ListServersParams) Keys

func (params *ListServersParams) Keys() []string

func (*ListServersParams) Limit added in v1.0.0

func (params *ListServersParams) Limit() int

func (*ListServersParams) Open

func (params *ListServersParams) Open() NullBool

func (*ListServersParams) PlayerSnapshotsCreatedAtLT added in v0.3.0

func (params *ListServersParams) PlayerSnapshotsCreatedAtLT() NullTime

func (*ListServersParams) SetCursor added in v1.0.0

func (params *ListServersParams) SetCursor(cursor ServerCursor) error

func (*ListServersParams) SetEncodedCursor added in v1.0.0

func (params *ListServersParams) SetEncodedCursor(encoded string) error

func (*ListServersParams) SetKeys added in v1.0.0

func (params *ListServersParams) SetKeys(keys []string) error

func (*ListServersParams) SetLimit added in v1.0.0

func (params *ListServersParams) SetLimit(limit int) error

func (*ListServersParams) SetOpen added in v1.0.0

func (params *ListServersParams) SetOpen(open NullBool) error

func (*ListServersParams) SetPlayerSnapshotsCreatedAtLT added in v1.0.0

func (params *ListServersParams) SetPlayerSnapshotsCreatedAtLT(playerSnapshotsCreatedAtLT NullTime) error

func (*ListServersParams) SetSnapshotCreatedAtLT added in v1.1.0

func (params *ListServersParams) SetSnapshotCreatedAtLT(snapshotCreatedAtLT NullTime) error

func (*ListServersParams) SetSort added in v1.0.0

func (params *ListServersParams) SetSort(sort []ServerSort) error

func (*ListServersParams) SetSpecial added in v1.0.0

func (params *ListServersParams) SetSpecial(special NullBool) error

func (*ListServersParams) SetTribeSnapshotsCreatedAtLT added in v1.0.0

func (params *ListServersParams) SetTribeSnapshotsCreatedAtLT(tribeSnapshotsCreatedAtLT NullTime) error

func (*ListServersParams) SetVersionCodes added in v1.0.0

func (params *ListServersParams) SetVersionCodes(versionCodes []string) error

func (*ListServersParams) SnapshotCreatedAtLT added in v1.1.0

func (params *ListServersParams) SnapshotCreatedAtLT() NullTime

func (*ListServersParams) Sort added in v1.0.0

func (params *ListServersParams) Sort() []ServerSort

func (*ListServersParams) Special

func (params *ListServersParams) Special() NullBool

func (*ListServersParams) TribeSnapshotsCreatedAtLT added in v0.3.0

func (params *ListServersParams) TribeSnapshotsCreatedAtLT() NullTime

func (*ListServersParams) VersionCodes

func (params *ListServersParams) VersionCodes() []string

type ListServersResult added in v1.0.0

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

func NewListServersResult added in v1.0.0

func NewListServersResult(servers Servers, next Server) (ListServersResult, error)

func (ListServersResult) Next added in v1.0.0

func (res ListServersResult) Next() ServerCursor

func (ListServersResult) Self added in v1.0.0

func (res ListServersResult) Self() ServerCursor

func (ListServersResult) Servers added in v1.0.0

func (res ListServersResult) Servers() Servers

type ListTribeChangesParams added in v0.7.5

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

func NewListTribeChangesParams added in v1.0.0

func NewListTribeChangesParams() ListTribeChangesParams

func (*ListTribeChangesParams) Before added in v1.0.0

func (params *ListTribeChangesParams) Before() NullTime

func (*ListTribeChangesParams) Cursor added in v1.0.0

func (params *ListTribeChangesParams) Cursor() TribeChangeCursor

func (*ListTribeChangesParams) Limit added in v1.0.0

func (params *ListTribeChangesParams) Limit() int

func (*ListTribeChangesParams) PlayerIDs added in v0.7.5

func (params *ListTribeChangesParams) PlayerIDs() []int

func (*ListTribeChangesParams) PrependSort added in v1.0.0

func (params *ListTribeChangesParams) PrependSort(sort []TribeChangeSort) error

func (*ListTribeChangesParams) PrependSortString added in v1.0.0

func (params *ListTribeChangesParams) PrependSortString(
	sort []string,
	allowed []TribeChangeSort,
	maxLength int,
) error

func (*ListTribeChangesParams) ServerKeys added in v0.7.5

func (params *ListTribeChangesParams) ServerKeys() []string

func (*ListTribeChangesParams) SetBefore added in v1.0.0

func (params *ListTribeChangesParams) SetBefore(before NullTime) error

func (*ListTribeChangesParams) SetCursor added in v1.0.0

func (params *ListTribeChangesParams) SetCursor(cursor TribeChangeCursor) error

func (*ListTribeChangesParams) SetEncodedCursor added in v1.0.0

func (params *ListTribeChangesParams) SetEncodedCursor(encoded string) error

func (*ListTribeChangesParams) SetLimit added in v1.0.0

func (params *ListTribeChangesParams) SetLimit(limit int) error

func (*ListTribeChangesParams) SetPlayerIDs added in v1.0.0

func (params *ListTribeChangesParams) SetPlayerIDs(playerIDs []int) error

func (*ListTribeChangesParams) SetServerKeys added in v1.0.0

func (params *ListTribeChangesParams) SetServerKeys(serverKeys []string) error

func (*ListTribeChangesParams) SetSince added in v1.0.0

func (params *ListTribeChangesParams) SetSince(since NullTime) error

func (*ListTribeChangesParams) SetSort added in v1.0.0

func (params *ListTribeChangesParams) SetSort(sort []TribeChangeSort) error

func (*ListTribeChangesParams) SetTribeIDs added in v1.0.0

func (params *ListTribeChangesParams) SetTribeIDs(tribeIDs []int) error

func (*ListTribeChangesParams) Since added in v1.0.0

func (params *ListTribeChangesParams) Since() NullTime

func (*ListTribeChangesParams) Sort added in v0.7.5

func (params *ListTribeChangesParams) Sort() []TribeChangeSort

func (*ListTribeChangesParams) TribeIDs added in v0.11.0

func (params *ListTribeChangesParams) TribeIDs() []int

type ListTribeChangesResult added in v1.0.0

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

func NewListTribeChangesResult added in v1.0.0

func NewListTribeChangesResult(tribeChanges TribeChanges, next TribeChange) (ListTribeChangesResult, error)

func (ListTribeChangesResult) Next added in v1.0.0

func (ListTribeChangesResult) Self added in v1.0.0

func (ListTribeChangesResult) TribeChanges added in v1.0.0

func (res ListTribeChangesResult) TribeChanges() TribeChanges

type ListTribeChangesWithRelationsResult added in v1.0.0

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

func NewListTribeChangesWithRelationsResult added in v1.0.0

func NewListTribeChangesWithRelationsResult(
	tribeChanges TribeChangesWithRelations,
	next TribeChangeWithRelations,
) (ListTribeChangesWithRelationsResult, error)

func (ListTribeChangesWithRelationsResult) Next added in v1.0.0

func (ListTribeChangesWithRelationsResult) Self added in v1.0.0

func (ListTribeChangesWithRelationsResult) TribeChanges added in v1.0.0

type ListTribeSnapshotsParams added in v0.6.0

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

func NewListTribeSnapshotsParams added in v1.0.0

func NewListTribeSnapshotsParams() ListTribeSnapshotsParams

func (*ListTribeSnapshotsParams) Cursor added in v1.0.0

func (*ListTribeSnapshotsParams) Limit added in v1.0.0

func (params *ListTribeSnapshotsParams) Limit() int

func (*ListTribeSnapshotsParams) PrependSort added in v1.0.0

func (params *ListTribeSnapshotsParams) PrependSort(sort []TribeSnapshotSort) error

func (*ListTribeSnapshotsParams) PrependSortString added in v1.0.0

func (params *ListTribeSnapshotsParams) PrependSortString(
	sort []string,
	allowed []TribeSnapshotSort,
	maxLength int,
) error

func (*ListTribeSnapshotsParams) ServerKeys added in v0.6.0

func (params *ListTribeSnapshotsParams) ServerKeys() []string

func (*ListTribeSnapshotsParams) SetCursor added in v1.0.0

func (params *ListTribeSnapshotsParams) SetCursor(cursor TribeSnapshotCursor) error

func (*ListTribeSnapshotsParams) SetEncodedCursor added in v1.0.0

func (params *ListTribeSnapshotsParams) SetEncodedCursor(encoded string) error

func (*ListTribeSnapshotsParams) SetLimit added in v1.0.0

func (params *ListTribeSnapshotsParams) SetLimit(limit int) error

func (*ListTribeSnapshotsParams) SetServerKeys added in v1.0.0

func (params *ListTribeSnapshotsParams) SetServerKeys(serverKeys []string) error

func (*ListTribeSnapshotsParams) SetSort added in v1.0.0

func (params *ListTribeSnapshotsParams) SetSort(sort []TribeSnapshotSort) error

func (*ListTribeSnapshotsParams) SetTribeIDs added in v1.0.0

func (params *ListTribeSnapshotsParams) SetTribeIDs(tribeIDs []int) error

func (*ListTribeSnapshotsParams) Sort added in v0.10.0

func (*ListTribeSnapshotsParams) TribeIDs added in v0.10.0

func (params *ListTribeSnapshotsParams) TribeIDs() []int

type ListTribeSnapshotsResult added in v1.0.0

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

func NewListTribeSnapshotsResult added in v1.0.0

func NewListTribeSnapshotsResult(
	snapshots TribeSnapshots,
	next TribeSnapshot,
) (ListTribeSnapshotsResult, error)

func (ListTribeSnapshotsResult) Next added in v1.0.0

func (ListTribeSnapshotsResult) Self added in v1.0.0

func (ListTribeSnapshotsResult) TribeSnapshots added in v1.0.0

func (res ListTribeSnapshotsResult) TribeSnapshots() TribeSnapshots

type ListTribeSnapshotsWithRelationsResult added in v1.0.0

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

func NewListTribeSnapshotsWithRelationsResult added in v1.0.0

func NewListTribeSnapshotsWithRelationsResult(
	snapshots TribeSnapshotsWithRelations,
	next TribeSnapshotWithRelations,
) (ListTribeSnapshotsWithRelationsResult, error)

func (ListTribeSnapshotsWithRelationsResult) Next added in v1.0.0

func (ListTribeSnapshotsWithRelationsResult) Self added in v1.0.0

func (ListTribeSnapshotsWithRelationsResult) TribeSnapshots added in v1.0.0

type ListTribesParams

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

func NewListTribesParams added in v1.0.0

func NewListTribesParams() ListTribesParams

func (*ListTribesParams) Cursor added in v1.0.0

func (params *ListTribesParams) Cursor() TribeCursor

func (*ListTribesParams) Deleted

func (params *ListTribesParams) Deleted() NullBool

func (*ListTribesParams) IDs

func (params *ListTribesParams) IDs() []int

func (*ListTribesParams) Limit added in v1.0.0

func (params *ListTribesParams) Limit() int

func (*ListTribesParams) PrependSort added in v1.8.0

func (params *ListTribesParams) PrependSort(sort []TribeSort) error

func (*ListTribesParams) PrependSortString added in v1.0.0

func (params *ListTribesParams) PrependSortString(sort []string, allowed []TribeSort, maxLength int) error

func (*ListTribesParams) Q added in v1.5.0

func (params *ListTribesParams) Q() NullString

func (*ListTribesParams) ServerKeys

func (params *ListTribesParams) ServerKeys() []string

func (*ListTribesParams) SetCursor added in v1.0.0

func (params *ListTribesParams) SetCursor(cursor TribeCursor) error

func (*ListTribesParams) SetDeleted added in v1.0.0

func (params *ListTribesParams) SetDeleted(deleted NullBool) error

func (*ListTribesParams) SetEncodedCursor added in v1.0.0

func (params *ListTribesParams) SetEncodedCursor(encoded string) error

func (*ListTribesParams) SetIDs added in v1.0.0

func (params *ListTribesParams) SetIDs(ids []int) error

func (*ListTribesParams) SetLimit added in v1.0.0

func (params *ListTribesParams) SetLimit(limit int) error

func (*ListTribesParams) SetQ added in v1.5.0

func (params *ListTribesParams) SetQ(q NullString) error

func (*ListTribesParams) SetServerKeys added in v1.0.0

func (params *ListTribesParams) SetServerKeys(serverKeys []string) error

func (*ListTribesParams) SetSort added in v1.0.0

func (params *ListTribesParams) SetSort(sort []TribeSort) error

func (*ListTribesParams) SetTags added in v1.0.0

func (params *ListTribesParams) SetTags(tags []string) error

func (*ListTribesParams) SetVersionCodes added in v1.8.0

func (params *ListTribesParams) SetVersionCodes(versionCodes []string) error

func (*ListTribesParams) Sort

func (params *ListTribesParams) Sort() []TribeSort

func (*ListTribesParams) Tags

func (params *ListTribesParams) Tags() []string

func (*ListTribesParams) VersionCodes added in v1.8.0

func (params *ListTribesParams) VersionCodes() []string

type ListTribesResult added in v1.0.0

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

func NewListTribesResult added in v1.0.0

func NewListTribesResult(tribes Tribes, next Tribe) (ListTribesResult, error)

func (ListTribesResult) Next added in v1.0.0

func (res ListTribesResult) Next() TribeCursor

func (ListTribesResult) Self added in v1.0.0

func (res ListTribesResult) Self() TribeCursor

func (ListTribesResult) Tribes added in v1.0.0

func (res ListTribesResult) Tribes() Tribes

type ListTribesWithRelationsResult added in v1.8.0

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

func NewListTribesWithRelationsResult added in v1.8.0

func NewListTribesWithRelationsResult(
	tribes TribesWithRelations,
	next TribeWithRelations,
) (ListTribesWithRelationsResult, error)

func (ListTribesWithRelationsResult) Next added in v1.8.0

func (ListTribesWithRelationsResult) Self added in v1.8.0

func (ListTribesWithRelationsResult) Tribes added in v1.8.0

type ListVersionsParams

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

func NewListVersionsParams added in v1.0.0

func NewListVersionsParams() ListVersionsParams

func (*ListVersionsParams) Codes added in v1.0.0

func (params *ListVersionsParams) Codes() []string

func (*ListVersionsParams) Cursor added in v1.0.0

func (params *ListVersionsParams) Cursor() VersionCursor

func (*ListVersionsParams) Limit added in v1.0.0

func (params *ListVersionsParams) Limit() int

func (*ListVersionsParams) SetCodes added in v1.0.0

func (params *ListVersionsParams) SetCodes(codes []string) error

func (*ListVersionsParams) SetCursor added in v1.0.0

func (params *ListVersionsParams) SetCursor(vc VersionCursor) error

func (*ListVersionsParams) SetEncodedCursor added in v1.0.0

func (params *ListVersionsParams) SetEncodedCursor(encoded string) error

func (*ListVersionsParams) SetLimit added in v1.0.0

func (params *ListVersionsParams) SetLimit(limit int) error

func (*ListVersionsParams) SetSort added in v1.0.0

func (params *ListVersionsParams) SetSort(sort []VersionSort) error

func (*ListVersionsParams) Sort added in v1.0.0

func (params *ListVersionsParams) Sort() []VersionSort

type ListVersionsResult added in v1.0.0

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

func NewListVersionsResult added in v1.0.0

func NewListVersionsResult(versions Versions, next Version) (ListVersionsResult, error)

func (ListVersionsResult) Next added in v1.0.0

func (res ListVersionsResult) Next() VersionCursor

func (ListVersionsResult) Self added in v1.0.0

func (res ListVersionsResult) Self() VersionCursor

func (ListVersionsResult) Versions added in v1.0.0

func (res ListVersionsResult) Versions() Versions

type ListVillagesParams

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

func NewListVillagesParams added in v1.0.0

func NewListVillagesParams() ListVillagesParams

func (*ListVillagesParams) Coords added in v0.12.3

func (params *ListVillagesParams) Coords() []Coords

func (*ListVillagesParams) Cursor added in v1.0.0

func (params *ListVillagesParams) Cursor() VillageCursor

func (*ListVillagesParams) IDs

func (params *ListVillagesParams) IDs() []int

func (*ListVillagesParams) Limit added in v1.0.0

func (params *ListVillagesParams) Limit() int

func (*ListVillagesParams) PlayerIDs added in v1.0.0

func (params *ListVillagesParams) PlayerIDs() []int

func (*ListVillagesParams) ServerKeys

func (params *ListVillagesParams) ServerKeys() []string

func (*ListVillagesParams) SetCoords added in v1.0.0

func (params *ListVillagesParams) SetCoords(coords []Coords) error

func (*ListVillagesParams) SetCoordsString added in v1.0.0

func (params *ListVillagesParams) SetCoordsString(rawCoords []string) error

func (*ListVillagesParams) SetCursor added in v1.0.0

func (params *ListVillagesParams) SetCursor(cursor VillageCursor) error

func (*ListVillagesParams) SetEncodedCursor added in v1.0.0

func (params *ListVillagesParams) SetEncodedCursor(encoded string) error

func (*ListVillagesParams) SetIDs added in v1.0.0

func (params *ListVillagesParams) SetIDs(ids []int) error

func (*ListVillagesParams) SetLimit added in v1.0.0

func (params *ListVillagesParams) SetLimit(limit int) error

func (*ListVillagesParams) SetPlayerIDs added in v1.0.0

func (params *ListVillagesParams) SetPlayerIDs(playerIDs []int) error

func (*ListVillagesParams) SetServerKeys added in v1.0.0

func (params *ListVillagesParams) SetServerKeys(serverKeys []string) error

func (*ListVillagesParams) SetSort added in v1.0.0

func (params *ListVillagesParams) SetSort(sort []VillageSort) error

func (*ListVillagesParams) SetTribeIDs added in v1.0.0

func (params *ListVillagesParams) SetTribeIDs(tribeIDs []int) error

func (*ListVillagesParams) Sort added in v1.0.0

func (params *ListVillagesParams) Sort() []VillageSort

func (*ListVillagesParams) TribeIDs added in v1.0.0

func (params *ListVillagesParams) TribeIDs() []int

type ListVillagesResult added in v1.0.0

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

func NewListVillagesResult added in v1.0.0

func NewListVillagesResult(villages Villages, next Village) (ListVillagesResult, error)

func (ListVillagesResult) Next added in v1.0.0

func (res ListVillagesResult) Next() VillageCursor

func (ListVillagesResult) Self added in v1.0.0

func (res ListVillagesResult) Self() VillageCursor

func (ListVillagesResult) Villages added in v1.0.0

func (res ListVillagesResult) Villages() Villages

type ListVillagesWithRelationsResult added in v1.0.0

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

func NewListVillagesWithRelationsResult added in v1.0.0

func NewListVillagesWithRelationsResult(
	villages VillagesWithRelations,
	next VillageWithRelations,
) (ListVillagesWithRelationsResult, error)

func (ListVillagesWithRelationsResult) Next added in v1.0.0

func (ListVillagesWithRelationsResult) Self added in v1.0.0

func (ListVillagesWithRelationsResult) Villages added in v1.0.0

type MaxLessEqualError added in v1.0.0

type MaxLessEqualError[T float32 | float64 | int] struct {
	Max     T
	Current T
}

func (MaxLessEqualError[T]) Code added in v1.0.0

func (e MaxLessEqualError[T]) Code() string

func (MaxLessEqualError[T]) Error added in v1.0.0

func (e MaxLessEqualError[T]) Error() string

func (MaxLessEqualError[T]) Params added in v1.0.0

func (e MaxLessEqualError[T]) Params() map[string]any

func (MaxLessEqualError[T]) Type added in v1.0.0

func (e MaxLessEqualError[T]) Type() ErrorType

type MinGreaterEqualError added in v1.0.0

type MinGreaterEqualError[T float32 | float64 | int] struct {
	Min     T
	Current T
}

func (MinGreaterEqualError[T]) Code added in v1.0.0

func (e MinGreaterEqualError[T]) Code() string

func (MinGreaterEqualError[T]) Error added in v1.0.0

func (e MinGreaterEqualError[T]) Error() string

func (MinGreaterEqualError[T]) Params added in v1.0.0

func (e MinGreaterEqualError[T]) Params() map[string]any

func (MinGreaterEqualError[T]) Type added in v1.0.0

func (e MinGreaterEqualError[T]) Type() ErrorType

type NullBool

type NullBool = NullValue[bool]

type NullBuildingInfo

type NullBuildingInfo = NullValue[BuildingInfo]

type NullInt added in v1.0.0

type NullInt = NullValue[int]

type NullPlayerMeta added in v0.2.0

type NullPlayerMeta NullValue[PlayerMeta]

func (NullPlayerMeta) IsZero added in v1.0.0

func (p NullPlayerMeta) IsZero() bool

func (NullPlayerMeta) WithRelations added in v1.0.0

type NullPlayerMetaWithRelations added in v0.2.0

type NullPlayerMetaWithRelations NullValue[PlayerMetaWithRelations]

func (NullPlayerMetaWithRelations) IsZero added in v1.0.0

func (p NullPlayerMetaWithRelations) IsZero() bool

type NullServerConfig

type NullServerConfig = NullValue[ServerConfig]

type NullString added in v1.0.0

type NullString = NullValue[string]

type NullTime

type NullTime = NullValue[time.Time]

type NullTribeMeta added in v0.2.0

type NullTribeMeta NullValue[TribeMeta]

func (NullTribeMeta) IsZero added in v1.0.0

func (t NullTribeMeta) IsZero() bool

type NullUnitInfo

type NullUnitInfo = NullValue[UnitInfo]

type NullValue added in v1.0.0

type NullValue[T any] struct {
	V     T
	Valid bool // Valid is true if V is not NULL
}

type OpponentsDefeated

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

func NewOpponentsDefeated added in v1.0.0

func NewOpponentsDefeated(
	rankAtt int,
	scoreAtt int,
	rankDef int,
	scoreDef int,
	rankSup int,
	scoreSup int,
	rankTotal int,
	scoreTotal int,
) (OpponentsDefeated, error)

func (OpponentsDefeated) RankAtt

func (o OpponentsDefeated) RankAtt() int

func (OpponentsDefeated) RankDef

func (o OpponentsDefeated) RankDef() int

func (OpponentsDefeated) RankSup

func (o OpponentsDefeated) RankSup() int

func (OpponentsDefeated) RankTotal

func (o OpponentsDefeated) RankTotal() int

func (OpponentsDefeated) ScoreAtt

func (o OpponentsDefeated) ScoreAtt() int

func (OpponentsDefeated) ScoreDef

func (o OpponentsDefeated) ScoreDef() int

func (OpponentsDefeated) ScoreSup

func (o OpponentsDefeated) ScoreSup() int

func (OpponentsDefeated) ScoreTotal

func (o OpponentsDefeated) ScoreTotal() int

type Player

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

func UnmarshalPlayerFromDatabase added in v1.0.0

func UnmarshalPlayerFromDatabase(
	id int,
	serverKey string,
	name string,
	numVillages int,
	points int,
	rank int,
	tribeID int,
	od OpponentsDefeated,
	rawProfileURL string,
	bestRank int,
	bestRankAt time.Time,
	mostPoints int,
	mostPointsAt time.Time,
	mostVillages int,
	mostVillagesAt time.Time,
	lastActivityAt time.Time,
	createdAt time.Time,
	deletedAt time.Time,
) (Player, error)

UnmarshalPlayerFromDatabase unmarshals Player from the database.

It should be used only for unmarshalling from the database! You can't use UnmarshalPlayerFromDatabase as constructor - It may put domain into the invalid state!

func (Player) Base added in v1.0.0

func (p Player) Base() BasePlayer

func (Player) BestRank added in v0.4.5

func (p Player) BestRank() int

func (Player) BestRankAt added in v0.4.5

func (p Player) BestRankAt() time.Time

func (Player) CreatedAt

func (p Player) CreatedAt() time.Time

func (Player) DeletedAt

func (p Player) DeletedAt() time.Time

func (Player) ID added in v0.2.0

func (p Player) ID() int

func (Player) IsDeleted added in v1.0.0

func (p Player) IsDeleted() bool

func (Player) IsZero added in v1.0.0

func (p Player) IsZero() bool

func (Player) LastActivityAt added in v0.4.5

func (p Player) LastActivityAt() time.Time

func (Player) Meta added in v1.0.0

func (p Player) Meta() PlayerMeta

func (Player) MostPoints added in v0.4.5

func (p Player) MostPoints() int

func (Player) MostPointsAt added in v0.4.5

func (p Player) MostPointsAt() time.Time

func (Player) MostVillages added in v0.4.5

func (p Player) MostVillages() int

func (Player) MostVillagesAt added in v0.4.5

func (p Player) MostVillagesAt() time.Time

func (Player) Name added in v0.2.0

func (p Player) Name() string

func (Player) NumVillages added in v0.2.0

func (p Player) NumVillages() int

func (Player) OD added in v1.0.0

func (p Player) OD() OpponentsDefeated

func (Player) Points added in v0.2.0

func (p Player) Points() int

func (Player) ProfileURL added in v0.2.0

func (p Player) ProfileURL() *url.URL

func (Player) Rank added in v0.2.0

func (p Player) Rank() int

func (Player) ServerKey

func (p Player) ServerKey() string

func (Player) ToCursor added in v1.0.0

func (p Player) ToCursor() (PlayerCursor, error)

func (Player) TribeID added in v0.2.0

func (p Player) TribeID() int

func (Player) WithRelations added in v1.0.0

func (p Player) WithRelations(server ServerMeta, tribe NullTribeMeta) PlayerWithRelations

type PlayerCursor added in v1.0.0

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

func NewPlayerCursor added in v1.0.0

func NewPlayerCursor(
	id int,
	serverKey string,
	odScoreAtt int,
	odScoreDef int,
	odScoreSup int,
	odScoreTotal int,
	points int,
	mostPoints int,
	deletedAt time.Time,
) (PlayerCursor, error)

func (PlayerCursor) DeletedAt added in v1.0.0

func (pc PlayerCursor) DeletedAt() time.Time

func (PlayerCursor) Encode added in v1.0.0

func (pc PlayerCursor) Encode() string

func (PlayerCursor) ID added in v1.0.0

func (pc PlayerCursor) ID() int

func (PlayerCursor) IsZero added in v1.0.0

func (pc PlayerCursor) IsZero() bool

func (PlayerCursor) MostPoints added in v1.4.0

func (pc PlayerCursor) MostPoints() int

func (PlayerCursor) ODScoreAtt added in v1.0.0

func (pc PlayerCursor) ODScoreAtt() int

func (PlayerCursor) ODScoreDef added in v1.0.0

func (pc PlayerCursor) ODScoreDef() int

func (PlayerCursor) ODScoreSup added in v1.0.0

func (pc PlayerCursor) ODScoreSup() int

func (PlayerCursor) ODScoreTotal added in v1.0.0

func (pc PlayerCursor) ODScoreTotal() int

func (PlayerCursor) Points added in v1.0.0

func (pc PlayerCursor) Points() int

func (PlayerCursor) ServerKey added in v1.0.0

func (pc PlayerCursor) ServerKey() string

type PlayerMeta added in v0.2.0

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

func UnmarshalPlayerMetaFromDatabase added in v1.0.0

func UnmarshalPlayerMetaFromDatabase(id int, name string, rawProfileURL string) (PlayerMeta, error)

UnmarshalPlayerMetaFromDatabase unmarshals PlayerMeta from the database.

It should be used only for unmarshalling from the database! You can't use UnmarshalPlayerMetaFromDatabase as constructor - It may put domain into the invalid state!

func (PlayerMeta) ID added in v0.2.0

func (p PlayerMeta) ID() int

func (PlayerMeta) IsZero added in v1.0.0

func (p PlayerMeta) IsZero() bool

func (PlayerMeta) Name added in v0.2.0

func (p PlayerMeta) Name() string

func (PlayerMeta) ProfileURL added in v0.2.0

func (p PlayerMeta) ProfileURL() *url.URL

func (PlayerMeta) WithRelations added in v1.0.0

func (p PlayerMeta) WithRelations(tribe NullTribeMeta) PlayerMetaWithRelations

type PlayerMetaWithRelations added in v0.2.0

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

func (PlayerMetaWithRelations) IsZero added in v1.0.0

func (p PlayerMetaWithRelations) IsZero() bool

func (PlayerMetaWithRelations) Player added in v1.0.0

func (PlayerMetaWithRelations) Tribe added in v0.2.0

type PlayerNotFoundError

type PlayerNotFoundError struct {
	ID        int
	ServerKey string
}

func (PlayerNotFoundError) Code

func (e PlayerNotFoundError) Code() string

func (PlayerNotFoundError) Error

func (e PlayerNotFoundError) Error() string

func (PlayerNotFoundError) Params added in v1.0.0

func (e PlayerNotFoundError) Params() map[string]any

func (PlayerNotFoundError) Type added in v1.0.0

func (e PlayerNotFoundError) Type() ErrorType

type PlayerSnapshot added in v0.3.0

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

func UnmarshalPlayerSnapshotFromDatabase added in v1.0.0

func UnmarshalPlayerSnapshotFromDatabase(
	id int,
	playerID int,
	serverKey string,
	numVillages int,
	points int,
	rank int,
	tribeID int,
	od OpponentsDefeated,
	date time.Time,
	createdAt time.Time,
) (PlayerSnapshot, error)

UnmarshalPlayerSnapshotFromDatabase unmarshals PlayerSnapshot from the database.

It should be used only for unmarshalling from the database! You can't use UnmarshalPlayerSnapshotFromDatabase as constructor - It may put domain into the invalid state!

func (PlayerSnapshot) CreatedAt added in v0.3.0

func (ps PlayerSnapshot) CreatedAt() time.Time

func (PlayerSnapshot) Date added in v0.3.0

func (ps PlayerSnapshot) Date() time.Time

func (PlayerSnapshot) ID added in v0.3.0

func (ps PlayerSnapshot) ID() int

func (PlayerSnapshot) IsZero added in v1.0.0

func (ps PlayerSnapshot) IsZero() bool

func (PlayerSnapshot) NumVillages added in v0.3.0

func (ps PlayerSnapshot) NumVillages() int

func (PlayerSnapshot) OD added in v1.0.0

func (PlayerSnapshot) PlayerID added in v0.3.0

func (ps PlayerSnapshot) PlayerID() int

func (PlayerSnapshot) Points added in v0.3.0

func (ps PlayerSnapshot) Points() int

func (PlayerSnapshot) Rank added in v0.3.0

func (ps PlayerSnapshot) Rank() int

func (PlayerSnapshot) ServerKey added in v0.3.0

func (ps PlayerSnapshot) ServerKey() string

func (PlayerSnapshot) ToCursor added in v1.0.0

func (ps PlayerSnapshot) ToCursor() (PlayerSnapshotCursor, error)

func (PlayerSnapshot) TribeID added in v0.3.0

func (ps PlayerSnapshot) TribeID() int

func (PlayerSnapshot) WithRelations added in v1.0.0

func (ps PlayerSnapshot) WithRelations(player PlayerMeta, tribe NullTribeMeta) PlayerSnapshotWithRelations

type PlayerSnapshotCursor added in v1.0.0

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

func NewPlayerSnapshotCursor added in v1.0.0

func NewPlayerSnapshotCursor(id int, serverKey string, date time.Time) (PlayerSnapshotCursor, error)

func (PlayerSnapshotCursor) Date added in v1.0.0

func (psc PlayerSnapshotCursor) Date() time.Time

func (PlayerSnapshotCursor) Encode added in v1.0.0

func (psc PlayerSnapshotCursor) Encode() string

func (PlayerSnapshotCursor) ID added in v1.0.0

func (psc PlayerSnapshotCursor) ID() int

func (PlayerSnapshotCursor) IsZero added in v1.0.0

func (psc PlayerSnapshotCursor) IsZero() bool

func (PlayerSnapshotCursor) ServerKey added in v1.0.0

func (psc PlayerSnapshotCursor) ServerKey() string

type PlayerSnapshotSort added in v0.7.0

type PlayerSnapshotSort uint8
const (
	PlayerSnapshotSortDateASC PlayerSnapshotSort = iota + 1
	PlayerSnapshotSortDateDESC
	PlayerSnapshotSortIDASC
	PlayerSnapshotSortIDDESC
	PlayerSnapshotSortServerKeyASC
	PlayerSnapshotSortServerKeyDESC
)

func (PlayerSnapshotSort) IsInConflict added in v1.0.0

func (s PlayerSnapshotSort) IsInConflict(s2 PlayerSnapshotSort) bool

IsInConflict returns true if two sorts can't be used together (e.g. PlayerSnapshotSortIDASC and PlayerSnapshotSortIDDESC).

func (PlayerSnapshotSort) String added in v1.0.0

func (s PlayerSnapshotSort) String() string

type PlayerSnapshotWithRelations added in v0.7.0

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

func (PlayerSnapshotWithRelations) IsZero added in v1.0.0

func (ps PlayerSnapshotWithRelations) IsZero() bool

func (PlayerSnapshotWithRelations) Player added in v1.0.0

func (PlayerSnapshotWithRelations) PlayerSnapshot added in v1.0.0

func (ps PlayerSnapshotWithRelations) PlayerSnapshot() PlayerSnapshot

func (PlayerSnapshotWithRelations) Tribe added in v0.7.0

type PlayerSnapshots added in v1.0.0

type PlayerSnapshots []PlayerSnapshot

type PlayerSnapshotsWithRelations added in v1.0.0

type PlayerSnapshotsWithRelations []PlayerSnapshotWithRelations

type PlayerSort

type PlayerSort uint8
const (
	PlayerSortIDASC PlayerSort = iota + 1
	PlayerSortIDDESC
	PlayerSortServerKeyASC
	PlayerSortServerKeyDESC
	PlayerSortODScoreAttASC
	PlayerSortODScoreAttDESC
	PlayerSortODScoreDefASC
	PlayerSortODScoreDefDESC
	PlayerSortODScoreSupASC
	PlayerSortODScoreSupDESC
	PlayerSortODScoreTotalASC
	PlayerSortODScoreTotalDESC
	PlayerSortPointsASC
	PlayerSortPointsDESC
	PlayerSortMostPointsASC
	PlayerSortMostPointsDESC
	PlayerSortDeletedAtASC
	PlayerSortDeletedAtDESC
)

func (PlayerSort) IsInConflict added in v1.0.0

func (s PlayerSort) IsInConflict(s2 PlayerSort) bool

IsInConflict returns true if two sorts can't be used together (e.g. PlayerSortIDASC and PlayerSortIDDESC).

func (PlayerSort) String added in v1.0.0

func (s PlayerSort) String() string

type PlayerWithRelations added in v0.2.0

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

func (PlayerWithRelations) IsZero added in v1.0.0

func (p PlayerWithRelations) IsZero() bool

func (PlayerWithRelations) Meta added in v1.0.0

func (PlayerWithRelations) Player added in v1.0.0

func (p PlayerWithRelations) Player() Player

func (PlayerWithRelations) Server added in v0.8.3

func (p PlayerWithRelations) Server() ServerMeta

func (PlayerWithRelations) Tribe added in v0.2.0

type Players added in v1.0.0

type Players []Player

func (Players) Delete added in v1.0.0

func (ps Players) Delete(serverKey string, active BasePlayers) ([]int, []CreateTribeChangeParams, error)

Delete finds all players with the given serverKey that are not in the given slice with active players and returns their ids + tribe changes that must be created. Both slices must be sorted in ascending order by ID. + if ps contains players from different servers. they must be sorted in ascending order by server key.

type PlayersSyncedEventPayload added in v1.0.0

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

func NewPlayersSyncedEventPayload added in v1.0.0

func NewPlayersSyncedEventPayload(
	serverKey string,
	serverURL *url.URL,
	versionCode string,
	numPlayers int,
	numActivePlayers int,
) (PlayersSyncedEventPayload, error)

func (PlayersSyncedEventPayload) NumActivePlayers added in v1.0.1

func (p PlayersSyncedEventPayload) NumActivePlayers() int

func (PlayersSyncedEventPayload) NumInactivePlayers added in v1.1.0

func (p PlayersSyncedEventPayload) NumInactivePlayers() int

func (PlayersSyncedEventPayload) NumPlayers added in v1.0.0

func (p PlayersSyncedEventPayload) NumPlayers() int

func (PlayersSyncedEventPayload) ServerKey added in v1.0.0

func (p PlayersSyncedEventPayload) ServerKey() string

func (PlayersSyncedEventPayload) ServerURL added in v1.0.0

func (p PlayersSyncedEventPayload) ServerURL() *url.URL

func (PlayersSyncedEventPayload) VersionCode added in v1.0.0

func (p PlayersSyncedEventPayload) VersionCode() string

type PlayersWithRelations added in v1.0.0

type PlayersWithRelations []PlayerWithRelations

type Server

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

func UnmarshalServerFromDatabase added in v1.0.0

func UnmarshalServerFromDatabase(
	key string,
	versionCode string,
	rawURL string,
	open bool,
	special bool,
	numPlayers int,
	numActivePlayers int,
	numInactivePlayers int,
	numTribes int,
	numActiveTribes int,
	numInactiveTribes int,
	numVillages int,
	numPlayerVillages int,
	numBarbarianVillages int,
	numBonusVillages int,
	config ServerConfig,
	buildingInfo BuildingInfo,
	unitInfo UnitInfo,
	createdAt time.Time,
	snapshotCreatedAt time.Time,
	playerDataSyncedAt time.Time,
	playerSnapshotsCreatedAt time.Time,
	tribeDataSyncedAt time.Time,
	tribeSnapshotsCreatedAt time.Time,
	villageDataSyncedAt time.Time,
	ennoblementDataSyncedAt time.Time,
) (Server, error)

UnmarshalServerFromDatabase unmarshals Server from the database.

It should be used only for unmarshalling from the database! You can't use UnmarshalServerFromDatabase as constructor - It may put domain into the invalid state!

func (Server) Base added in v1.0.0

func (s Server) Base() BaseServer

func (Server) BuildingInfo

func (s Server) BuildingInfo() BuildingInfo

func (Server) Config

func (s Server) Config() ServerConfig

func (Server) CreatedAt

func (s Server) CreatedAt() time.Time

func (Server) EnnoblementDataSyncedAt added in v1.0.0

func (s Server) EnnoblementDataSyncedAt() time.Time

func (Server) IsZero added in v1.0.0

func (s Server) IsZero() bool

func (Server) Key

func (s Server) Key() string

func (Server) Meta added in v1.0.0

func (s Server) Meta() ServerMeta

func (Server) NumActivePlayers added in v1.0.1

func (s Server) NumActivePlayers() int

func (Server) NumActiveTribes added in v1.0.1

func (s Server) NumActiveTribes() int

func (Server) NumBarbarianVillages added in v0.6.2

func (s Server) NumBarbarianVillages() int

func (Server) NumBonusVillages added in v0.6.2

func (s Server) NumBonusVillages() int

func (Server) NumInactivePlayers added in v1.1.0

func (s Server) NumInactivePlayers() int

func (Server) NumInactiveTribes added in v1.1.0

func (s Server) NumInactiveTribes() int

func (Server) NumPlayerVillages added in v0.6.2

func (s Server) NumPlayerVillages() int

func (Server) NumPlayers

func (s Server) NumPlayers() int

func (Server) NumTribes

func (s Server) NumTribes() int

func (Server) NumVillages

func (s Server) NumVillages() int

func (Server) Open

func (s Server) Open() bool

func (Server) PlayerDataSyncedAt added in v1.0.0

func (s Server) PlayerDataSyncedAt() time.Time

func (Server) PlayerSnapshotsCreatedAt added in v0.3.0

func (s Server) PlayerSnapshotsCreatedAt() time.Time

func (Server) SnapshotCreatedAt added in v1.1.0

func (s Server) SnapshotCreatedAt() time.Time

func (Server) Special

func (s Server) Special() bool

func (Server) ToCursor added in v1.0.0

func (s Server) ToCursor() (ServerCursor, error)

func (Server) TribeDataSyncedAt added in v1.0.0

func (s Server) TribeDataSyncedAt() time.Time

func (Server) TribeSnapshotsCreatedAt added in v0.3.0

func (s Server) TribeSnapshotsCreatedAt() time.Time

func (Server) URL

func (s Server) URL() *url.URL

func (Server) UnitInfo

func (s Server) UnitInfo() UnitInfo

func (Server) VersionCode

func (s Server) VersionCode() string

func (Server) VillageDataSyncedAt added in v1.0.0

func (s Server) VillageDataSyncedAt() time.Time

type ServerConfig

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

func NewServerConfig added in v1.0.0

func (ServerConfig) Ally

func (s ServerConfig) Ally() ServerConfigAlly

func (ServerConfig) Build

func (s ServerConfig) Build() ServerConfigBuild

func (ServerConfig) Buildings

func (s ServerConfig) Buildings() ServerConfigBuildings

func (ServerConfig) Commands

func (s ServerConfig) Commands() ServerConfigCommands

func (ServerConfig) Coord

func (s ServerConfig) Coord() ServerConfigCoord

func (ServerConfig) Game

func (s ServerConfig) Game() ServerConfigGame

func (ServerConfig) Misc

func (s ServerConfig) Misc() ServerConfigMisc

func (ServerConfig) Moral

func (s ServerConfig) Moral() int

func (ServerConfig) Newbie

func (s ServerConfig) Newbie() ServerConfigNewbie

func (ServerConfig) Night

func (s ServerConfig) Night() ServerConfigNight

func (ServerConfig) Sitter

func (s ServerConfig) Sitter() ServerConfigSitter

func (ServerConfig) Sleep

func (s ServerConfig) Sleep() ServerConfigSleep

func (ServerConfig) Snob

func (s ServerConfig) Snob() ServerConfigSnob

func (ServerConfig) Speed

func (s ServerConfig) Speed() float64

func (ServerConfig) UnitSpeed

func (s ServerConfig) UnitSpeed() float64

func (ServerConfig) Win

func (s ServerConfig) Win() ServerConfigWin

type ServerConfigAlly

type ServerConfigAlly struct {
	AllytimeSupport       int
	FixedAllies           int
	Levels                int
	Limit                 int
	NoHarm                int
	NoJoin                int
	NoLeave               int
	NoOtherSupport        int
	NoOtherSupportType    int
	PointsMemberCount     int
	WarsAutoacceptDays    int
	WarsMemberRequirement int
	WarsPointsRequirement int
	XpRequirements        string
}

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 ServerConfigCommands struct {
	CommandCancelTime int
	MillisArrival     int
}

type ServerConfigCoord

type ServerConfigCoord struct {
	BonusNew        int
	BonusVillages   int
	EmptyVillages   int
	Func            int
	Inner           int
	MapSize         int
	NobleRestart    int
	SelectStart     int
	StartVillages   int
	VillageMoveWait int
}

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 ServerConfigMisc struct {
	KillRanking     int
	TradeCancelTime int
	Tutorial        int
}

type ServerConfigNewbie

type ServerConfigNewbie struct {
	Days                 int
	Ratio                int
	RatioDays            int
	RemoveNewbieVillages int
}

type ServerConfigNight

type ServerConfigNight struct {
	Active    int
	DefFactor float64
	Duration  int
	EndHour   int
	StartHour int
}

type ServerConfigSitter

type ServerConfigSitter struct {
	Allow int
}

type ServerConfigSleep

type ServerConfigSleep struct {
	Active   int
	Delay    int
	Max      int
	MaxAwake int
	Min      int
	MinAwake int
	WarnTime int
}

type ServerConfigSnob

type ServerConfigSnob struct {
	CheapRebuild  int
	CoinIron      int
	CoinStone     int
	CoinWood      int
	Factor        float64
	Gold          int
	MaxDist       int
	NoBarbConquer int
	Rise          int
}

type ServerConfigWin

type ServerConfigWin struct {
	Check int
}

type ServerCursor added in v1.0.0

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

func NewServerCursor added in v1.0.0

func NewServerCursor(key string, open bool) (ServerCursor, error)

func (ServerCursor) Encode added in v1.0.0

func (sc ServerCursor) Encode() string

func (ServerCursor) IsZero added in v1.0.0

func (sc ServerCursor) IsZero() bool

func (ServerCursor) Key added in v1.0.0

func (sc ServerCursor) Key() string

func (ServerCursor) Open added in v1.0.0

func (sc ServerCursor) Open() bool

type ServerMap added in v1.4.1

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

func NewServerMap added in v1.4.1

func NewServerMap(server Server, markersCh <-chan ServerMapMarker) ServerMap

func (*ServerMap) BackgroundColor added in v1.4.1

func (m *ServerMap) BackgroundColor() color.RGBA

func (*ServerMap) CenterX added in v1.4.1

func (m *ServerMap) CenterX() int

func (*ServerMap) CenterY added in v1.4.1

func (m *ServerMap) CenterY() int

func (*ServerMap) ContinentGrid added in v1.4.1

func (m *ServerMap) ContinentGrid() bool

func (*ServerMap) ContinentNumberColor added in v1.4.1

func (m *ServerMap) ContinentNumberColor() color.RGBA

func (*ServerMap) ContinentNumbers added in v1.4.1

func (m *ServerMap) ContinentNumbers() bool

func (*ServerMap) Generate added in v1.4.1

func (m *ServerMap) Generate(w io.Writer) error

func (*ServerMap) GridLineColor added in v1.4.1

func (m *ServerMap) GridLineColor() color.RGBA

func (*ServerMap) LegendEntries added in v1.4.1

func (m *ServerMap) LegendEntries() []ServerMapLegendEntry

func (*ServerMap) Scale added in v1.4.1

func (m *ServerMap) Scale() float32

func (*ServerMap) SetBackgroundColor added in v1.4.1

func (m *ServerMap) SetBackgroundColor(backgroundColor color.RGBA) error

func (*ServerMap) SetCenterX added in v1.4.1

func (m *ServerMap) SetCenterX(centerX int) error

func (*ServerMap) SetCenterY added in v1.4.1

func (m *ServerMap) SetCenterY(centerY int) error

func (*ServerMap) SetContinentGrid added in v1.4.1

func (m *ServerMap) SetContinentGrid(continentGrid bool) error

func (*ServerMap) SetContinentNumberColor added in v1.4.1

func (m *ServerMap) SetContinentNumberColor(continentNumberColor color.RGBA) error

func (*ServerMap) SetContinentNumbers added in v1.4.1

func (m *ServerMap) SetContinentNumbers(continentNumbers bool) error

func (*ServerMap) SetGridLineColor added in v1.4.1

func (m *ServerMap) SetGridLineColor(gridLineColor color.RGBA) error

func (*ServerMap) SetLegendEntries added in v1.4.1

func (m *ServerMap) SetLegendEntries(legendEntries []ServerMapLegendEntry) error

func (*ServerMap) SetScale added in v1.4.1

func (m *ServerMap) SetScale(scale float32) error

type ServerMapLegendEntry added in v1.4.1

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

func NewServerMapLegendEntry added in v1.4.1

func NewServerMapLegendEntry(c color.Color, names ...string) ServerMapLegendEntry

func (ServerMapLegendEntry) Color added in v1.4.1

func (e ServerMapLegendEntry) Color() color.Color

func (ServerMapLegendEntry) Names added in v1.4.1

func (e ServerMapLegendEntry) Names() []string

type ServerMapMarker added in v1.4.1

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

func NewServerMapMarker added in v1.4.1

func NewServerMapMarker(village VillageMeta) ServerMapMarker

func (*ServerMapMarker) Color added in v1.4.1

func (m *ServerMapMarker) Color() color.RGBA

func (*ServerMapMarker) SetColor added in v1.4.1

func (m *ServerMapMarker) SetColor(c color.RGBA) error

func (*ServerMapMarker) Village added in v1.4.1

func (m *ServerMapMarker) Village() VillageMeta

type ServerMeta added in v0.8.3

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

func UnmarshalServerMetaFromDatabase added in v1.0.0

func UnmarshalServerMetaFromDatabase(key string, rawURL string, open bool) (ServerMeta, error)

UnmarshalServerMetaFromDatabase unmarshals ServerMeta from the database.

It should be used only for unmarshalling from the database! You can't use UnmarshalServerMetaFromDatabase as constructor - It may put domain into the invalid state!

func (ServerMeta) Key added in v0.8.3

func (s ServerMeta) Key() string

func (ServerMeta) Open added in v0.8.3

func (s ServerMeta) Open() bool

func (ServerMeta) URL added in v0.8.3

func (s ServerMeta) URL() *url.URL

type ServerNotFoundError

type ServerNotFoundError struct {
	Key string
}

func (ServerNotFoundError) Code

func (e ServerNotFoundError) Code() string

func (ServerNotFoundError) Error

func (e ServerNotFoundError) Error() string

func (ServerNotFoundError) Params added in v1.0.0

func (e ServerNotFoundError) Params() map[string]any

func (ServerNotFoundError) Type added in v1.0.0

func (e ServerNotFoundError) Type() ErrorType

type ServerSnapshot added in v1.1.0

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

func UnmarshalServerSnapshotFromDatabase added in v1.1.0

func UnmarshalServerSnapshotFromDatabase(
	id int,
	serverKey string,
	numPlayers int,
	numActivePlayers int,
	numInactivePlayers int,
	numTribes int,
	numActiveTribes int,
	numInactiveTribes int,
	numVillages int,
	numPlayerVillages int,
	numBarbarianVillages int,
	numBonusVillages int,
	date time.Time,
	createdAt time.Time,
) (ServerSnapshot, error)

UnmarshalServerSnapshotFromDatabase unmarshals ServerSnapshot from the database.

It should be used only for unmarshalling from the database! You can't use UnmarshalServerSnapshotFromDatabase as constructor - It may put domain into the invalid state!

func (ServerSnapshot) CreatedAt added in v1.1.0

func (ss ServerSnapshot) CreatedAt() time.Time

func (ServerSnapshot) Date added in v1.1.0

func (ss ServerSnapshot) Date() time.Time

func (ServerSnapshot) ID added in v1.1.0

func (ss ServerSnapshot) ID() int

func (ServerSnapshot) IsZero added in v1.1.0

func (ss ServerSnapshot) IsZero() bool

func (ServerSnapshot) NumActivePlayers added in v1.1.0

func (ss ServerSnapshot) NumActivePlayers() int

func (ServerSnapshot) NumActiveTribes added in v1.1.0

func (ss ServerSnapshot) NumActiveTribes() int

func (ServerSnapshot) NumBarbarianVillages added in v1.1.0

func (ss ServerSnapshot) NumBarbarianVillages() int

func (ServerSnapshot) NumBonusVillages added in v1.1.0

func (ss ServerSnapshot) NumBonusVillages() int

func (ServerSnapshot) NumInactivePlayers added in v1.1.0

func (ss ServerSnapshot) NumInactivePlayers() int

func (ServerSnapshot) NumInactiveTribes added in v1.1.0

func (ss ServerSnapshot) NumInactiveTribes() int

func (ServerSnapshot) NumPlayerVillages added in v1.1.0

func (ss ServerSnapshot) NumPlayerVillages() int

func (ServerSnapshot) NumPlayers added in v1.1.0

func (ss ServerSnapshot) NumPlayers() int

func (ServerSnapshot) NumTribes added in v1.1.0

func (ss ServerSnapshot) NumTribes() int

func (ServerSnapshot) NumVillages added in v1.1.0

func (ss ServerSnapshot) NumVillages() int

func (ServerSnapshot) ServerKey added in v1.1.0

func (ss ServerSnapshot) ServerKey() string

func (ServerSnapshot) ToCursor added in v1.1.0

func (ss ServerSnapshot) ToCursor() (ServerSnapshotCursor, error)

func (ServerSnapshot) WithRelations added in v1.3.0

func (ss ServerSnapshot) WithRelations(server ServerMeta) ServerSnapshotWithRelations

type ServerSnapshotCursor added in v1.1.0

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

func NewServerSnapshotCursor added in v1.1.0

func NewServerSnapshotCursor(id int, serverKey string, date time.Time) (ServerSnapshotCursor, error)

func (ServerSnapshotCursor) Date added in v1.1.0

func (ssc ServerSnapshotCursor) Date() time.Time

func (ServerSnapshotCursor) Encode added in v1.1.0

func (ssc ServerSnapshotCursor) Encode() string

func (ServerSnapshotCursor) ID added in v1.1.0

func (ssc ServerSnapshotCursor) ID() int

func (ServerSnapshotCursor) IsZero added in v1.1.0

func (ssc ServerSnapshotCursor) IsZero() bool

func (ServerSnapshotCursor) ServerKey added in v1.1.0

func (ssc ServerSnapshotCursor) ServerKey() string

type ServerSnapshotSort added in v1.1.0

type ServerSnapshotSort uint8
const (
	ServerSnapshotSortDateASC ServerSnapshotSort = iota + 1
	ServerSnapshotSortDateDESC
	ServerSnapshotSortIDASC
	ServerSnapshotSortIDDESC
	ServerSnapshotSortServerKeyASC
	ServerSnapshotSortServerKeyDESC
)

func (ServerSnapshotSort) IsInConflict added in v1.1.0

func (s ServerSnapshotSort) IsInConflict(s2 ServerSnapshotSort) bool

IsInConflict returns true if two sorts can't be used together (e.g. ServerSnapshotSortIDASC and ServerSnapshotSortIDDESC).

func (ServerSnapshotSort) String added in v1.1.0

func (s ServerSnapshotSort) String() string

type ServerSnapshotWithRelations added in v1.3.0

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

func (ServerSnapshotWithRelations) IsZero added in v1.3.0

func (ts ServerSnapshotWithRelations) IsZero() bool

func (ServerSnapshotWithRelations) Server added in v1.3.0

func (ServerSnapshotWithRelations) ServerSnapshot added in v1.3.0

func (ts ServerSnapshotWithRelations) ServerSnapshot() ServerSnapshot

type ServerSnapshots added in v1.1.0

type ServerSnapshots []ServerSnapshot

type ServerSnapshotsWithRelations added in v1.3.0

type ServerSnapshotsWithRelations []ServerSnapshotWithRelations

type ServerSort added in v1.0.0

type ServerSort uint8
const (
	ServerSortKeyASC ServerSort = iota + 1
	ServerSortKeyDESC
	ServerSortOpenASC
	ServerSortOpenDESC
)

func (ServerSort) IsInConflict added in v1.0.0

func (s ServerSort) IsInConflict(s2 ServerSort) bool

IsInConflict returns true if two sorts can't be used together (e.g. ServerSortKeyASC and ServerSortKeyDESC).

func (ServerSort) String added in v1.0.0

func (s ServerSort) String() string

type ServerSyncedEventPayload added in v1.0.0

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

func NewServerSyncedEventPayload added in v1.0.0

func NewServerSyncedEventPayload(key string, u *url.URL, versionCode string) (ServerSyncedEventPayload, error)

func NewServerSyncedEventPayloads added in v1.0.0

func NewServerSyncedEventPayloads(servers BaseServers, versionCode string) ([]ServerSyncedEventPayload, error)

func (ServerSyncedEventPayload) Key added in v1.0.0

func (ServerSyncedEventPayload) URL added in v1.0.0

func (p ServerSyncedEventPayload) URL() *url.URL

func (ServerSyncedEventPayload) VersionCode added in v1.0.0

func (p ServerSyncedEventPayload) VersionCode() string

type Servers added in v1.0.0

type Servers []Server

func (Servers) CleanUpData added in v1.0.0

func (ss Servers) CleanUpData() ([]CleanUpDataCmdPayload, error)

CleanUpData finds all servers for which old data (ennoblements, snapshots etc.) can be deleted.

func (Servers) Close added in v1.0.0

func (ss Servers) Close(open BaseServers) (BaseServers, error)

Close finds all servers with Server.Open returning true that are not in the given slice with open servers and then converts them to BaseServers with the corrected open value.

type SliceElementValidationError added in v1.0.0

type SliceElementValidationError struct {
	Model string
	Field string
	Index int
	Err   error
}

func (SliceElementValidationError) Code added in v1.0.0

func (SliceElementValidationError) Error added in v1.0.0

func (SliceElementValidationError) Params added in v1.0.0

func (e SliceElementValidationError) Params() map[string]any

func (SliceElementValidationError) Path added in v1.0.0

func (SliceElementValidationError) Type added in v1.0.0

func (SliceElementValidationError) Unwrap added in v1.0.0

type SnapshotsCreatedEventPayload added in v1.0.0

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

func NewSnapshotsCreatedEventPayload added in v1.0.0

func NewSnapshotsCreatedEventPayload(serverKey string, versionCode string) (SnapshotsCreatedEventPayload, error)

func (SnapshotsCreatedEventPayload) ServerKey added in v1.0.0

func (p SnapshotsCreatedEventPayload) ServerKey() string

func (SnapshotsCreatedEventPayload) VersionCode added in v1.0.0

func (p SnapshotsCreatedEventPayload) VersionCode() string

type SortConflictError added in v1.0.0

type SortConflictError struct {
	Sort [2]string
}

func (SortConflictError) Code added in v1.0.0

func (e SortConflictError) Code() string

func (SortConflictError) Error added in v1.0.0

func (e SortConflictError) Error() string

func (SortConflictError) Params added in v1.0.0

func (e SortConflictError) Params() map[string]any

func (SortConflictError) Type added in v1.0.0

func (e SortConflictError) Type() ErrorType

type SyncEnnoblementsCmdPayload added in v1.0.0

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

func NewSyncEnnoblementsCmdPayload added in v1.0.0

func NewSyncEnnoblementsCmdPayload(
	serverKey string,
	serverURL *url.URL,
	versionCode string,
) (SyncEnnoblementsCmdPayload, error)

func (SyncEnnoblementsCmdPayload) ServerKey added in v1.0.0

func (p SyncEnnoblementsCmdPayload) ServerKey() string

func (SyncEnnoblementsCmdPayload) ServerURL added in v1.0.0

func (p SyncEnnoblementsCmdPayload) ServerURL() *url.URL

func (SyncEnnoblementsCmdPayload) VersionCode added in v1.0.0

func (p SyncEnnoblementsCmdPayload) VersionCode() string

type SyncServersCmdPayload added in v1.0.0

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

func NewSyncServersCmdPayload added in v1.0.0

func NewSyncServersCmdPayload(versionCode string, u *url.URL) (SyncServersCmdPayload, error)

func (SyncServersCmdPayload) URL added in v1.0.0

func (p SyncServersCmdPayload) URL() *url.URL

func (SyncServersCmdPayload) VersionCode added in v1.0.0

func (p SyncServersCmdPayload) VersionCode() string

type Tribe

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

func UnmarshalTribeFromDatabase added in v1.0.0

func UnmarshalTribeFromDatabase(
	id int,
	serverKey string,
	name string,
	tag string,
	numMembers int,
	numVillages int,
	points int,
	allPoints int,
	rank int,
	od OpponentsDefeated,
	rawProfileURL string,
	dominance float64,
	bestRank int,
	bestRankAt time.Time,
	mostPoints int,
	mostPointsAt time.Time,
	mostVillages int,
	mostVillagesAt time.Time,
	createdAt time.Time,
	deletedAt time.Time,
) (Tribe, error)

UnmarshalTribeFromDatabase unmarshals Tribe from the database.

It should be used only for unmarshalling from the database! You can't use UnmarshalTribeFromDatabase as constructor - It may put domain into the invalid state!

func (Tribe) AllPoints added in v0.2.0

func (t Tribe) AllPoints() int

func (Tribe) Base added in v1.0.0

func (t Tribe) Base() BaseTribe

func (Tribe) BestRank added in v0.4.5

func (t Tribe) BestRank() int

func (Tribe) BestRankAt added in v0.4.5

func (t Tribe) BestRankAt() time.Time

func (Tribe) CreatedAt

func (t Tribe) CreatedAt() time.Time

func (Tribe) DeletedAt

func (t Tribe) DeletedAt() time.Time

func (Tribe) Dominance

func (t Tribe) Dominance() float64

func (Tribe) ID added in v0.2.0

func (t Tribe) ID() int

func (Tribe) IsDeleted added in v1.0.0

func (t Tribe) IsDeleted() bool

func (Tribe) IsZero added in v1.0.0

func (t Tribe) IsZero() bool

func (Tribe) Meta added in v1.0.0

func (t Tribe) Meta() TribeMeta

func (Tribe) MostPoints added in v0.4.5

func (t Tribe) MostPoints() int

func (Tribe) MostPointsAt added in v0.4.5

func (t Tribe) MostPointsAt() time.Time

func (Tribe) MostVillages added in v0.4.5

func (t Tribe) MostVillages() int

func (Tribe) MostVillagesAt added in v0.4.5

func (t Tribe) MostVillagesAt() time.Time

func (Tribe) Name added in v0.2.0

func (t Tribe) Name() string

func (Tribe) NumMembers added in v0.2.0

func (t Tribe) NumMembers() int

func (Tribe) NumVillages added in v0.2.0

func (t Tribe) NumVillages() int

func (Tribe) OD added in v1.0.0

func (t Tribe) OD() OpponentsDefeated

func (Tribe) Points added in v0.2.0

func (t Tribe) Points() int

func (Tribe) ProfileURL added in v0.2.0

func (t Tribe) ProfileURL() *url.URL

func (Tribe) Rank added in v0.2.0

func (t Tribe) Rank() int

func (Tribe) ServerKey

func (t Tribe) ServerKey() string

func (Tribe) Tag added in v0.2.0

func (t Tribe) Tag() string

func (Tribe) ToCursor added in v1.0.0

func (t Tribe) ToCursor() (TribeCursor, error)

func (Tribe) WithRelations added in v1.8.0

func (t Tribe) WithRelations(server ServerMeta) TribeWithRelations

type TribeChange added in v0.4.0

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

func UnmarshalTribeChangeFromDatabase added in v1.0.0

func UnmarshalTribeChangeFromDatabase(
	id int,
	serverKey string,
	playerID int,
	oldTribeID int,
	newTribeID int,
	createdAt time.Time,
) (TribeChange, error)

UnmarshalTribeChangeFromDatabase unmarshals TribeChange from the database.

It should be used only for unmarshalling from the database! You can't use UnmarshalTribeChangeFromDatabase as constructor - It may put domain into the invalid state!

func (TribeChange) CreatedAt added in v0.4.0

func (tc TribeChange) CreatedAt() time.Time

func (TribeChange) ID added in v0.4.0

func (tc TribeChange) ID() int

func (TribeChange) IsZero added in v1.0.0

func (tc TribeChange) IsZero() bool

func (TribeChange) NewTribeID added in v0.4.0

func (tc TribeChange) NewTribeID() int

func (TribeChange) OldTribeID added in v0.4.0

func (tc TribeChange) OldTribeID() int

func (TribeChange) PlayerID added in v0.4.0

func (tc TribeChange) PlayerID() int

func (TribeChange) ServerKey added in v0.4.0

func (tc TribeChange) ServerKey() string

func (TribeChange) ToCursor added in v1.0.0

func (tc TribeChange) ToCursor() (TribeChangeCursor, error)

func (TribeChange) WithRelations added in v1.0.0

func (tc TribeChange) WithRelations(
	player PlayerMeta,
	oldTribe NullTribeMeta,
	newTribe NullTribeMeta,
) TribeChangeWithRelations

type TribeChangeCursor added in v1.0.0

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

func NewTribeChangeCursor added in v1.0.0

func NewTribeChangeCursor(id int, serverKey string, createdAt time.Time) (TribeChangeCursor, error)

func (TribeChangeCursor) CreatedAt added in v1.0.0

func (tcc TribeChangeCursor) CreatedAt() time.Time

func (TribeChangeCursor) Encode added in v1.0.0

func (tcc TribeChangeCursor) Encode() string

func (TribeChangeCursor) ID added in v1.0.0

func (tcc TribeChangeCursor) ID() int

func (TribeChangeCursor) IsZero added in v1.0.0

func (tcc TribeChangeCursor) IsZero() bool

func (TribeChangeCursor) ServerKey added in v1.0.0

func (tcc TribeChangeCursor) ServerKey() string

type TribeChangeSort added in v0.7.5

type TribeChangeSort uint8
const (
	TribeChangeSortCreatedAtASC TribeChangeSort = iota + 1
	TribeChangeSortCreatedAtDESC
	TribeChangeSortIDASC
	TribeChangeSortIDDESC
	TribeChangeSortServerKeyASC
	TribeChangeSortServerKeyDESC
)

func (TribeChangeSort) IsInConflict added in v1.0.0

func (s TribeChangeSort) IsInConflict(s2 TribeChangeSort) bool

IsInConflict returns true if two sorts can't be used together (e.g. TribeChangeSortIDASC and TribeChangeSortIDDESC).

func (TribeChangeSort) String added in v1.0.0

func (s TribeChangeSort) String() string

type TribeChangeWithRelations added in v0.7.5

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

func (TribeChangeWithRelations) IsZero added in v1.0.0

func (tc TribeChangeWithRelations) IsZero() bool

func (TribeChangeWithRelations) NewTribe added in v0.7.5

func (TribeChangeWithRelations) OldTribe added in v0.7.5

func (TribeChangeWithRelations) Player added in v0.7.5

func (TribeChangeWithRelations) TribeChange added in v1.0.0

func (tc TribeChangeWithRelations) TribeChange() TribeChange

type TribeChanges added in v1.0.0

type TribeChanges []TribeChange

type TribeChangesWithRelations added in v1.0.0

type TribeChangesWithRelations []TribeChangeWithRelations

type TribeCursor added in v1.0.0

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

func NewTribeCursor added in v1.0.0

func NewTribeCursor(
	id int,
	serverKey string,
	odScoreAtt int,
	odScoreDef int,
	odScoreTotal int,
	points int,
	mostPoints int,
	dominance float64,
	deletedAt time.Time,
) (TribeCursor, error)

func (TribeCursor) DeletedAt added in v1.0.0

func (tc TribeCursor) DeletedAt() time.Time

func (TribeCursor) Dominance added in v1.0.0

func (tc TribeCursor) Dominance() float64

func (TribeCursor) Encode added in v1.0.0

func (tc TribeCursor) Encode() string

func (TribeCursor) ID added in v1.0.0

func (tc TribeCursor) ID() int

func (TribeCursor) IsZero added in v1.0.0

func (tc TribeCursor) IsZero() bool

func (TribeCursor) MostPoints added in v1.4.0

func (tc TribeCursor) MostPoints() int

func (TribeCursor) ODScoreAtt added in v1.0.0

func (tc TribeCursor) ODScoreAtt() int

func (TribeCursor) ODScoreDef added in v1.0.0

func (tc TribeCursor) ODScoreDef() int

func (TribeCursor) ODScoreTotal added in v1.0.0

func (tc TribeCursor) ODScoreTotal() int

func (TribeCursor) Points added in v1.0.0

func (tc TribeCursor) Points() int

func (TribeCursor) ServerKey added in v1.0.0

func (tc TribeCursor) ServerKey() string

type TribeMeta added in v0.2.0

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

func UnmarshalTribeMetaFromDatabase added in v1.0.0

func UnmarshalTribeMetaFromDatabase(id int, name string, tag string, rawProfileURL string) (TribeMeta, error)

UnmarshalTribeMetaFromDatabase unmarshals TribeMeta from the database.

It should be used only for unmarshalling from the database! You can't use UnmarshalTribeMetaFromDatabase as constructor - It may put domain into the invalid state!

func (TribeMeta) ID added in v0.2.0

func (t TribeMeta) ID() int

func (TribeMeta) IsZero added in v1.0.0

func (t TribeMeta) IsZero() bool

func (TribeMeta) Name added in v0.2.0

func (t TribeMeta) Name() string

func (TribeMeta) ProfileURL added in v0.2.0

func (t TribeMeta) ProfileURL() *url.URL

func (TribeMeta) Tag added in v0.2.0

func (t TribeMeta) Tag() string

type TribeNotFoundError

type TribeNotFoundError struct {
	ID        int
	ServerKey string
}

func (TribeNotFoundError) Code

func (e TribeNotFoundError) Code() string

func (TribeNotFoundError) Error

func (e TribeNotFoundError) Error() string

func (TribeNotFoundError) Params added in v1.0.0

func (e TribeNotFoundError) Params() map[string]any

func (TribeNotFoundError) Type added in v1.0.0

func (e TribeNotFoundError) Type() ErrorType

type TribeSnapshot added in v0.3.0

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

func UnmarshalTribeSnapshotFromDatabase added in v1.0.0

func UnmarshalTribeSnapshotFromDatabase(
	id int,
	tribeID int,
	serverKey string,
	numMembers int,
	numVillages int,
	points int,
	allPoints int,
	rank int,
	od OpponentsDefeated,
	dominance float64,
	date time.Time,
	createdAt time.Time,
) (TribeSnapshot, error)

UnmarshalTribeSnapshotFromDatabase unmarshals TribeSnapshot from the database.

It should be used only for unmarshalling from the database! You can't use UnmarshalTribeSnapshotFromDatabase as constructor - It may put domain into the invalid state!

func (TribeSnapshot) AllPoints added in v0.3.0

func (ts TribeSnapshot) AllPoints() int

func (TribeSnapshot) CreatedAt added in v0.3.0

func (ts TribeSnapshot) CreatedAt() time.Time

func (TribeSnapshot) Date added in v0.3.0

func (ts TribeSnapshot) Date() time.Time

func (TribeSnapshot) Dominance added in v0.3.0

func (ts TribeSnapshot) Dominance() float64

func (TribeSnapshot) ID added in v0.3.0

func (ts TribeSnapshot) ID() int

func (TribeSnapshot) IsZero added in v1.0.0

func (ts TribeSnapshot) IsZero() bool

func (TribeSnapshot) NumMembers added in v0.3.0

func (ts TribeSnapshot) NumMembers() int

func (TribeSnapshot) NumVillages added in v0.3.0

func (ts TribeSnapshot) NumVillages() int

func (TribeSnapshot) OD added in v1.0.0

func (TribeSnapshot) Points added in v0.3.0

func (ts TribeSnapshot) Points() int

func (TribeSnapshot) Rank added in v0.3.0

func (ts TribeSnapshot) Rank() int

func (TribeSnapshot) ServerKey added in v0.3.0

func (ts TribeSnapshot) ServerKey() string

func (TribeSnapshot) ToCursor added in v1.0.0

func (ts TribeSnapshot) ToCursor() (TribeSnapshotCursor, error)

func (TribeSnapshot) TribeID added in v0.3.0

func (ts TribeSnapshot) TribeID() int

func (TribeSnapshot) WithRelations added in v1.0.0

func (ts TribeSnapshot) WithRelations(tribe TribeMeta) TribeSnapshotWithRelations

type TribeSnapshotCursor added in v1.0.0

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

func NewTribeSnapshotCursor added in v1.0.0

func NewTribeSnapshotCursor(id int, serverKey string, date time.Time) (TribeSnapshotCursor, error)

func (TribeSnapshotCursor) Date added in v1.0.0

func (tsc TribeSnapshotCursor) Date() time.Time

func (TribeSnapshotCursor) Encode added in v1.0.0

func (tsc TribeSnapshotCursor) Encode() string

func (TribeSnapshotCursor) ID added in v1.0.0

func (tsc TribeSnapshotCursor) ID() int

func (TribeSnapshotCursor) IsZero added in v1.0.0

func (tsc TribeSnapshotCursor) IsZero() bool

func (TribeSnapshotCursor) ServerKey added in v1.0.0

func (tsc TribeSnapshotCursor) ServerKey() string

type TribeSnapshotSort added in v0.10.0

type TribeSnapshotSort uint8
const (
	TribeSnapshotSortDateASC TribeSnapshotSort = iota + 1
	TribeSnapshotSortDateDESC
	TribeSnapshotSortIDASC
	TribeSnapshotSortIDDESC
	TribeSnapshotSortServerKeyASC
	TribeSnapshotSortServerKeyDESC
)

func (TribeSnapshotSort) IsInConflict added in v1.0.0

func (s TribeSnapshotSort) IsInConflict(s2 TribeSnapshotSort) bool

IsInConflict returns true if two sorts can't be used together (e.g. TribeSnapshotSortIDASC and TribeSnapshotSortIDDESC).

func (TribeSnapshotSort) String added in v1.0.0

func (s TribeSnapshotSort) String() string

type TribeSnapshotWithRelations added in v1.0.0

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

func (TribeSnapshotWithRelations) IsZero added in v1.0.0

func (ts TribeSnapshotWithRelations) IsZero() bool

func (TribeSnapshotWithRelations) Tribe added in v1.0.0

func (TribeSnapshotWithRelations) TribeSnapshot added in v1.0.0

func (ts TribeSnapshotWithRelations) TribeSnapshot() TribeSnapshot

type TribeSnapshots added in v1.0.0

type TribeSnapshots []TribeSnapshot

type TribeSnapshotsWithRelations added in v1.0.0

type TribeSnapshotsWithRelations []TribeSnapshotWithRelations

type TribeSort

type TribeSort uint8
const (
	TribeSortIDASC TribeSort = iota + 1
	TribeSortIDDESC
	TribeSortServerKeyASC
	TribeSortServerKeyDESC
	TribeSortODScoreAttASC
	TribeSortODScoreAttDESC
	TribeSortODScoreDefASC
	TribeSortODScoreDefDESC
	TribeSortODScoreTotalASC
	TribeSortODScoreTotalDESC
	TribeSortPointsASC
	TribeSortPointsDESC
	TribeSortMostPointsASC
	TribeSortMostPointsDESC
	TribeSortDominanceASC
	TribeSortDominanceDESC
	TribeSortDeletedAtASC
	TribeSortDeletedAtDESC
)

func (TribeSort) IsInConflict added in v1.0.0

func (s TribeSort) IsInConflict(s2 TribeSort) bool

IsInConflict returns true if two sorts can't be used together (e.g. TribeSortIDASC and TribeSortIDDESC).

func (TribeSort) String added in v1.0.0

func (s TribeSort) String() string

type TribeWithRelations added in v1.8.0

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

func (TribeWithRelations) IsZero added in v1.8.0

func (t TribeWithRelations) IsZero() bool

func (TribeWithRelations) Server added in v1.8.0

func (t TribeWithRelations) Server() ServerMeta

func (TribeWithRelations) Tribe added in v1.8.0

func (t TribeWithRelations) Tribe() Tribe

type Tribes added in v1.0.0

type Tribes []Tribe

func (Tribes) Delete added in v1.0.0

func (ts Tribes) Delete(serverKey string, active BaseTribes) []int

Delete finds all tribes with the given serverKey that are not in the given slice with active tribes and returns their ids. Both slices must be sorted in ascending order by ID + if vs contains tribes from different servers. they must be sorted in ascending order by server key.

type TribesSyncedEventPayload added in v1.0.0

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

func NewTribesSyncedEventPayload added in v1.0.0

func NewTribesSyncedEventPayload(
	serverKey string,
	serverURL *url.URL,
	versionCode string,
	numTribes int,
	numActiveTribes int,
) (TribesSyncedEventPayload, error)

func (TribesSyncedEventPayload) NumActiveTribes added in v1.0.1

func (p TribesSyncedEventPayload) NumActiveTribes() int

func (TribesSyncedEventPayload) NumInactiveTribes added in v1.1.0

func (p TribesSyncedEventPayload) NumInactiveTribes() int

func (TribesSyncedEventPayload) NumTribes added in v1.0.0

func (p TribesSyncedEventPayload) NumTribes() int

func (TribesSyncedEventPayload) ServerKey added in v1.0.0

func (p TribesSyncedEventPayload) ServerKey() string

func (TribesSyncedEventPayload) ServerURL added in v1.0.0

func (p TribesSyncedEventPayload) ServerURL() *url.URL

func (TribesSyncedEventPayload) VersionCode added in v1.0.0

func (p TribesSyncedEventPayload) VersionCode() string

type TribesWithRelations added in v1.8.0

type TribesWithRelations []TribeWithRelations

type Unit

type Unit struct {
	Attack         int
	BuildTime      float64
	Carry          int
	Defense        int
	DefenseArcher  int
	DefenseCavalry int
	Pop            int
	Speed          float64
}

type UnitInfo

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

func NewUnitInfo added in v1.0.0

func NewUnitInfo(
	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,
) (UnitInfo, error)

func (UnitInfo) Archer

func (u UnitInfo) Archer() Unit

func (UnitInfo) Axe

func (u UnitInfo) Axe() Unit

func (UnitInfo) Catapult

func (u UnitInfo) Catapult() Unit

func (UnitInfo) Heavy

func (u UnitInfo) Heavy() Unit

func (UnitInfo) Knight

func (u UnitInfo) Knight() Unit

func (UnitInfo) Light

func (u UnitInfo) Light() Unit

func (UnitInfo) Marcher

func (u UnitInfo) Marcher() Unit

func (UnitInfo) Militia

func (u UnitInfo) Militia() Unit

func (UnitInfo) Ram

func (u UnitInfo) Ram() Unit

func (UnitInfo) Snob

func (u UnitInfo) Snob() Unit

func (UnitInfo) Spear

func (u UnitInfo) Spear() Unit

func (UnitInfo) Spy

func (u UnitInfo) Spy() Unit

func (UnitInfo) Sword

func (u UnitInfo) Sword() Unit

type UnsupportedSortStringError added in v1.0.0

type UnsupportedSortStringError struct {
	Sort string
}

func (UnsupportedSortStringError) Code added in v1.0.0

func (UnsupportedSortStringError) Error added in v1.0.0

func (UnsupportedSortStringError) Params added in v1.0.0

func (e UnsupportedSortStringError) Params() map[string]any

func (UnsupportedSortStringError) Type added in v1.0.0

type UpdateServerParams

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

func (*UpdateServerParams) BuildingInfo

func (params *UpdateServerParams) BuildingInfo() NullBuildingInfo

func (*UpdateServerParams) Config

func (params *UpdateServerParams) Config() NullServerConfig

func (*UpdateServerParams) EnnoblementDataSyncedAt added in v1.0.0

func (params *UpdateServerParams) EnnoblementDataSyncedAt() NullTime

func (*UpdateServerParams) IsZero

func (params *UpdateServerParams) IsZero() bool

func (*UpdateServerParams) NumActivePlayers added in v1.0.1

func (params *UpdateServerParams) NumActivePlayers() NullInt

func (*UpdateServerParams) NumActiveTribes added in v1.0.1

func (params *UpdateServerParams) NumActiveTribes() NullInt

func (*UpdateServerParams) NumBarbarianVillages added in v0.6.2

func (params *UpdateServerParams) NumBarbarianVillages() NullInt

func (*UpdateServerParams) NumBonusVillages added in v0.6.2

func (params *UpdateServerParams) NumBonusVillages() NullInt

func (*UpdateServerParams) NumInactivePlayers added in v1.1.0

func (params *UpdateServerParams) NumInactivePlayers() NullInt

func (*UpdateServerParams) NumInactiveTribes added in v1.1.0

func (params *UpdateServerParams) NumInactiveTribes() NullInt

func (*UpdateServerParams) NumPlayerVillages added in v0.6.2

func (params *UpdateServerParams) NumPlayerVillages() NullInt

func (*UpdateServerParams) NumPlayers

func (params *UpdateServerParams) NumPlayers() NullInt

func (*UpdateServerParams) NumTribes

func (params *UpdateServerParams) NumTribes() NullInt

func (*UpdateServerParams) NumVillages

func (params *UpdateServerParams) NumVillages() NullInt

func (*UpdateServerParams) PlayerDataSyncedAt added in v1.0.0

func (params *UpdateServerParams) PlayerDataSyncedAt() NullTime

func (*UpdateServerParams) PlayerSnapshotsCreatedAt added in v0.3.0

func (params *UpdateServerParams) PlayerSnapshotsCreatedAt() NullTime

func (*UpdateServerParams) SetBuildingInfo added in v1.0.0

func (params *UpdateServerParams) SetBuildingInfo(buildingInfo NullBuildingInfo) error

func (*UpdateServerParams) SetConfig added in v1.0.0

func (params *UpdateServerParams) SetConfig(config NullServerConfig) error

func (*UpdateServerParams) SetEnnoblementDataSyncedAt added in v1.0.0

func (params *UpdateServerParams) SetEnnoblementDataSyncedAt(ennoblementDataSyncedAt NullTime) error

func (*UpdateServerParams) SetNumActivePlayers added in v1.0.1

func (params *UpdateServerParams) SetNumActivePlayers(num NullInt) error

func (*UpdateServerParams) SetNumActiveTribes added in v1.0.1

func (params *UpdateServerParams) SetNumActiveTribes(num NullInt) error

func (*UpdateServerParams) SetNumBarbarianVillages added in v1.0.0

func (params *UpdateServerParams) SetNumBarbarianVillages(numBarbarianVillages NullInt) error

func (*UpdateServerParams) SetNumBonusVillages added in v1.0.0

func (params *UpdateServerParams) SetNumBonusVillages(numBonusVillages NullInt) error

func (*UpdateServerParams) SetNumInactivePlayers added in v1.1.0

func (params *UpdateServerParams) SetNumInactivePlayers(num NullInt) error

func (*UpdateServerParams) SetNumInactiveTribes added in v1.1.0

func (params *UpdateServerParams) SetNumInactiveTribes(num NullInt) error

func (*UpdateServerParams) SetNumPlayerVillages added in v1.0.0

func (params *UpdateServerParams) SetNumPlayerVillages(numPlayerVillages NullInt) error

func (*UpdateServerParams) SetNumPlayers added in v1.0.0

func (params *UpdateServerParams) SetNumPlayers(num NullInt) error

func (*UpdateServerParams) SetNumTribes added in v1.0.0

func (params *UpdateServerParams) SetNumTribes(num NullInt) error

func (*UpdateServerParams) SetNumVillages added in v1.0.0

func (params *UpdateServerParams) SetNumVillages(numVillages NullInt) error

func (*UpdateServerParams) SetPlayerDataSyncedAt added in v1.0.0

func (params *UpdateServerParams) SetPlayerDataSyncedAt(playerDataSyncedAt NullTime) error

func (*UpdateServerParams) SetPlayerSnapshotsCreatedAt added in v1.0.0

func (params *UpdateServerParams) SetPlayerSnapshotsCreatedAt(playerSnapshotsCreatedAt NullTime) error

func (*UpdateServerParams) SetSnapshotCreatedAt added in v1.1.0

func (params *UpdateServerParams) SetSnapshotCreatedAt(snapshotCreatedAt NullTime) error

func (*UpdateServerParams) SetTribeDataSyncedAt added in v1.0.0

func (params *UpdateServerParams) SetTribeDataSyncedAt(tribeDataSyncedAt NullTime) error

func (*UpdateServerParams) SetTribeSnapshotsCreatedAt added in v1.0.0

func (params *UpdateServerParams) SetTribeSnapshotsCreatedAt(tribeSnapshotsCreatedAt NullTime) error

func (*UpdateServerParams) SetUnitInfo added in v1.0.0

func (params *UpdateServerParams) SetUnitInfo(unitInfo NullUnitInfo) error

func (*UpdateServerParams) SetVillageDataSyncedAt added in v1.0.0

func (params *UpdateServerParams) SetVillageDataSyncedAt(villageDataSyncedAt NullTime) error

func (*UpdateServerParams) SnapshotCreatedAt added in v1.1.0

func (params *UpdateServerParams) SnapshotCreatedAt() NullTime

func (*UpdateServerParams) TribeDataSyncedAt added in v1.0.0

func (params *UpdateServerParams) TribeDataSyncedAt() NullTime

func (*UpdateServerParams) TribeSnapshotsCreatedAt added in v0.3.0

func (params *UpdateServerParams) TribeSnapshotsCreatedAt() NullTime

func (*UpdateServerParams) UnitInfo

func (params *UpdateServerParams) UnitInfo() NullUnitInfo

func (*UpdateServerParams) VillageDataSyncedAt added in v1.0.0

func (params *UpdateServerParams) VillageDataSyncedAt() NullTime

type ValidationError

type ValidationError struct {
	Model string
	Field string
	Err   error
}

func (ValidationError) Code

func (e ValidationError) Code() string

func (ValidationError) Error

func (e ValidationError) Error() string

func (ValidationError) Params added in v1.0.0

func (e ValidationError) Params() map[string]any

func (ValidationError) Path added in v1.0.0

func (ValidationError) Type added in v1.0.0

func (e ValidationError) Type() ErrorType

func (ValidationError) Unwrap

func (e ValidationError) Unwrap() error

type Version

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

func UnmarshalVersionFromDatabase added in v1.0.0

func UnmarshalVersionFromDatabase(
	code string,
	name string,
	host string,
	timezone string,
) (Version, error)

UnmarshalVersionFromDatabase unmarshals Version from the database.

It should be used only for unmarshalling from the database! You can't use UnmarshalVersionFromDatabase as constructor - It may put domain into the invalid state!

func (Version) Code

func (v Version) Code() string

func (Version) Host

func (v Version) Host() string

func (Version) IsZero added in v1.0.0

func (v Version) IsZero() bool

func (Version) Name

func (v Version) Name() string

func (Version) Timezone

func (v Version) Timezone() string

func (Version) ToCursor added in v1.0.0

func (v Version) ToCursor() (VersionCursor, error)

func (Version) URL added in v0.11.2

func (v Version) URL() *url.URL

type VersionCursor added in v1.0.0

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

func NewVersionCursor added in v1.0.0

func NewVersionCursor(code string) (VersionCursor, error)

func (VersionCursor) Code added in v1.0.0

func (vc VersionCursor) Code() string

func (VersionCursor) Encode added in v1.0.0

func (vc VersionCursor) Encode() string

func (VersionCursor) IsZero added in v1.0.0

func (vc VersionCursor) IsZero() bool

type VersionNotFoundError

type VersionNotFoundError struct {
	VersionCode string
}

func (VersionNotFoundError) Code

func (e VersionNotFoundError) Code() string

func (VersionNotFoundError) Error

func (e VersionNotFoundError) Error() string

func (VersionNotFoundError) Params added in v1.0.0

func (e VersionNotFoundError) Params() map[string]any

func (VersionNotFoundError) Type added in v1.0.0

type VersionSort added in v1.0.0

type VersionSort uint8
const (
	VersionSortCodeASC VersionSort = iota + 1
	VersionSortCodeDESC
)

func (VersionSort) IsInConflict added in v1.0.0

func (s VersionSort) IsInConflict(s2 VersionSort) bool

IsInConflict returns true if two sorts can't be used together (e.g. VersionSortCodeASC and VersionSortCodeDESC).

func (VersionSort) String added in v1.0.0

func (s VersionSort) String() string

type Versions added in v1.0.0

type Versions []Version

type Village

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

func UnmarshalVillageFromDatabase added in v1.0.0

func UnmarshalVillageFromDatabase(
	id int,
	serverKey string,
	name string,
	points int,
	x int,
	y int,
	continent string,
	bonus int,
	playerID int,
	rawProfileURL string,
	createdAt time.Time,
) (Village, error)

UnmarshalVillageFromDatabase unmarshals Village from the database.

It should be used only for unmarshalling from the database! You can't use UnmarshalVillageFromDatabase as constructor - It may put domain into the invalid state!

func (Village) Base added in v1.0.0

func (v Village) Base() BaseVillage

func (Village) Bonus added in v0.2.0

func (v Village) Bonus() int

func (Village) Continent added in v0.2.0

func (v Village) Continent() string

func (Village) Coords added in v1.0.0

func (v Village) Coords() Coords

func (Village) CreatedAt

func (v Village) CreatedAt() time.Time

func (Village) FullName

func (v Village) FullName() string

func (Village) ID added in v0.2.0

func (v Village) ID() int

func (Village) IsZero added in v1.0.0

func (v Village) IsZero() bool

func (Village) Meta added in v1.0.0

func (v Village) Meta() VillageMeta

func (Village) Name added in v0.2.0

func (v Village) Name() string

func (Village) PlayerID added in v0.2.0

func (v Village) PlayerID() int

func (Village) Points added in v0.2.0

func (v Village) Points() int

func (Village) ProfileURL added in v0.2.0

func (v Village) ProfileURL() *url.URL

func (Village) ServerKey

func (v Village) ServerKey() string

func (Village) ToCursor added in v1.0.0

func (v Village) ToCursor() (VillageCursor, error)

func (Village) WithRelations added in v1.0.0

func (Village) X added in v0.2.0

func (v Village) X() int

func (Village) Y added in v0.2.0

func (v Village) Y() int

type VillageCursor added in v1.0.0

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

func NewVillageCursor added in v1.0.0

func NewVillageCursor(id int, serverKey string) (VillageCursor, error)

func (VillageCursor) Encode added in v1.0.0

func (vc VillageCursor) Encode() string

func (VillageCursor) ID added in v1.0.0

func (vc VillageCursor) ID() int

func (VillageCursor) IsZero added in v1.0.0

func (vc VillageCursor) IsZero() bool

func (VillageCursor) ServerKey added in v1.0.0

func (vc VillageCursor) ServerKey() string

type VillageMeta added in v0.2.0

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

func UnmarshalVillageMetaFromDatabase added in v1.0.0

func UnmarshalVillageMetaFromDatabase(
	id int,
	name string,
	x int,
	y int,
	continent string,
	rawProfileURL string,
) (VillageMeta, error)

UnmarshalVillageMetaFromDatabase unmarshals VillageMeta from the database.

It should be used only for unmarshalling from the database! You can't use UnmarshalVillageMetaFromDatabase as constructor - It may put domain into the invalid state!

func (VillageMeta) Continent added in v0.2.0

func (v VillageMeta) Continent() string

func (VillageMeta) FullName added in v0.2.0

func (v VillageMeta) FullName() string

func (VillageMeta) ID added in v0.2.0

func (v VillageMeta) ID() int

func (VillageMeta) IsZero added in v1.0.0

func (v VillageMeta) IsZero() bool

func (VillageMeta) Name added in v0.2.0

func (v VillageMeta) Name() string

func (VillageMeta) ProfileURL added in v0.2.0

func (v VillageMeta) ProfileURL() *url.URL

func (VillageMeta) WithRelations added in v1.0.0

func (VillageMeta) X added in v0.2.0

func (v VillageMeta) X() int

func (VillageMeta) Y added in v0.2.0

func (v VillageMeta) Y() int

type VillageMetaWithRelations added in v0.8.0

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

func (VillageMetaWithRelations) Player added in v0.8.0

func (VillageMetaWithRelations) Village added in v1.0.0

type VillageNotFoundError

type VillageNotFoundError struct {
	ID        int
	ServerKey string
}

func (VillageNotFoundError) Code

func (e VillageNotFoundError) Code() string

func (VillageNotFoundError) Error

func (e VillageNotFoundError) Error() string

func (VillageNotFoundError) Params added in v1.0.0

func (e VillageNotFoundError) Params() map[string]any

func (VillageNotFoundError) Type added in v1.0.0

type VillageSort added in v1.0.0

type VillageSort uint8
const (
	VillageSortIDASC VillageSort = iota + 1
	VillageSortIDDESC
	VillageSortServerKeyASC
	VillageSortServerKeyDESC
)

func (VillageSort) IsInConflict added in v1.0.0

func (s VillageSort) IsInConflict(s2 VillageSort) bool

IsInConflict returns true if two sorts can't be used together (e.g. VillageSortIDASC and VillageSortIDDESC).

func (VillageSort) String added in v1.0.0

func (s VillageSort) String() string

type VillageWithRelations added in v0.2.0

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

func (VillageWithRelations) IsZero added in v1.0.0

func (v VillageWithRelations) IsZero() bool

func (VillageWithRelations) Player added in v0.2.0

func (VillageWithRelations) Village added in v1.0.0

func (v VillageWithRelations) Village() Village

type Villages added in v1.0.0

type Villages []Village

func (Villages) Delete added in v1.0.0

func (vs Villages) Delete(serverKey string, active BaseVillages) []int

Delete finds all villages with the given serverKey that are not in the given slice with active villages and returns their ids. Both slices must be sorted in ascending order by ID + if vs contains villages from different servers. they must be sorted in ascending order by server key.

type VillagesSyncedEventPayload added in v1.0.0

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

func NewVillagesSyncedEventPayload added in v1.0.0

func NewVillagesSyncedEventPayload(
	serverKey string,
	serverURL *url.URL,
	versionCode string,
	numVillages int,
	numPlayerVillages int,
	numBarbarianVillages int,
	numBonusVillages int,
) (VillagesSyncedEventPayload, error)

func NewVillagesSyncedEventPayloadFromVillages added in v1.0.0

func NewVillagesSyncedEventPayloadFromVillages(
	serverKey string,
	serverURL *url.URL,
	versionCode string,
	villages BaseVillages,
) (VillagesSyncedEventPayload, error)

func (VillagesSyncedEventPayload) NumBarbarianVillages added in v1.0.0

func (p VillagesSyncedEventPayload) NumBarbarianVillages() int

func (VillagesSyncedEventPayload) NumBonusVillages added in v1.0.0

func (p VillagesSyncedEventPayload) NumBonusVillages() int

func (VillagesSyncedEventPayload) NumPlayerVillages added in v1.0.0

func (p VillagesSyncedEventPayload) NumPlayerVillages() int

func (VillagesSyncedEventPayload) NumVillages added in v1.0.0

func (p VillagesSyncedEventPayload) NumVillages() int

func (VillagesSyncedEventPayload) ServerKey added in v1.0.0

func (p VillagesSyncedEventPayload) ServerKey() string

func (VillagesSyncedEventPayload) ServerURL added in v1.0.0

func (p VillagesSyncedEventPayload) ServerURL() *url.URL

func (VillagesSyncedEventPayload) VersionCode added in v1.0.0

func (p VillagesSyncedEventPayload) VersionCode() string

type VillagesWithRelations added in v1.0.0

type VillagesWithRelations []VillageWithRelations

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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