domaintest

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBaseEnnoblement

func NewBaseEnnoblement(tb TestingTB, opts ...func(cfg *BaseEnnoblementConfig)) domain.BaseEnnoblement

func NewBasePlayer

func NewBasePlayer(tb TestingTB, opts ...func(cfg *BasePlayerConfig)) domain.BasePlayer

func NewBaseServer

func NewBaseServer(tb TestingTB, opts ...func(cfg *BaseServerConfig)) domain.BaseServer

func NewBaseTribe

func NewBaseTribe(tb TestingTB, opts ...func(cfg *BaseTribeConfig)) domain.BaseTribe

func NewBaseVillage

func NewBaseVillage(tb TestingTB, opts ...func(cfg *BaseVillageConfig)) domain.BaseVillage

func NewBuildingInfo

func NewBuildingInfo(tb TestingTB) domain.BuildingInfo

func NewCleanUpDataCmdPayload

func NewCleanUpDataCmdPayload(
	tb TestingTB,
	opts ...func(cfg *CleanUpDataCmdPayloadConfig),
) domain.CleanUpDataCmdPayload

func NewEnnoblement

func NewEnnoblement(tb TestingTB, opts ...func(cfg *EnnoblementConfig)) domain.Ennoblement

func NewEnnoblementCursor

func NewEnnoblementCursor(tb TestingTB, opts ...func(cfg *EnnoblementCursorConfig)) domain.EnnoblementCursor

func NewEnnoblementWithRelations

func NewEnnoblementWithRelations(
	tb TestingTB,
	opts ...func(cfg *EnnoblementWithRelationsConfig),
) domain.EnnoblementWithRelations

func NewOpponentsDefeated

func NewOpponentsDefeated(tb TestingTB, opts ...func(cfg *OpponentsDefeatedConfig)) domain.OpponentsDefeated

func NewPlayer

func NewPlayer(tb TestingTB, opts ...func(cfg *PlayerConfig)) domain.Player

func NewPlayerCursor

func NewPlayerCursor(tb TestingTB, opts ...func(cfg *PlayerCursorConfig)) domain.PlayerCursor

func NewPlayerSnapshot

func NewPlayerSnapshot(tb TestingTB, opts ...func(cfg *PlayerSnapshotConfig)) domain.PlayerSnapshot

func NewPlayerSnapshotCursor

func NewPlayerSnapshotCursor(tb TestingTB, opts ...func(cfg *PlayerSnapshotCursorConfig)) domain.PlayerSnapshotCursor

func NewPlayerSnapshotWithRelations

func NewPlayerSnapshotWithRelations(
	tb TestingTB,
	opts ...func(cfg *PlayerSnapshotWithRelationsConfig),
) domain.PlayerSnapshotWithRelations

func NewPlayerWithRelations

func NewPlayerWithRelations(tb TestingTB, opts ...func(cfg *PlayerWithRelationsConfig)) domain.PlayerWithRelations

func NewServer

func NewServer(tb TestingTB, opts ...func(cfg *ServerConfig)) domain.Server

func NewServerConfig

func NewServerConfig(tb TestingTB) domain.ServerConfig

func NewServerCursor

func NewServerCursor(tb TestingTB, opts ...func(cfg *ServerCursorConfig)) domain.ServerCursor

func NewServerSnapshot added in v1.1.0

func NewServerSnapshot(tb TestingTB, opts ...func(cfg *ServerSnapshotConfig)) domain.ServerSnapshot

func NewServerSnapshotCursor added in v1.1.0

func NewServerSnapshotCursor(tb TestingTB, opts ...func(cfg *ServerSnapshotCursorConfig)) domain.ServerSnapshotCursor

func NewServerSnapshotWithRelations added in v1.3.0

func NewServerSnapshotWithRelations(
	tb TestingTB,
	opts ...func(cfg *ServerSnapshotWithRelationsConfig),
) domain.ServerSnapshotWithRelations

func NewTribe

func NewTribe(tb TestingTB, opts ...func(cfg *TribeConfig)) domain.Tribe

func NewTribeChange

func NewTribeChange(tb TestingTB, opts ...func(cfg *TribeChangeConfig)) domain.TribeChange

func NewTribeChangeCursor

func NewTribeChangeCursor(tb TestingTB, opts ...func(cfg *TribeChangeCursorConfig)) domain.TribeChangeCursor

func NewTribeChangeWithRelations

func NewTribeChangeWithRelations(
	tb TestingTB,
	opts ...func(cfg *TribeChangeWithRelationsConfig),
) domain.TribeChangeWithRelations

func NewTribeCursor

func NewTribeCursor(tb TestingTB, opts ...func(cfg *TribeCursorConfig)) domain.TribeCursor

func NewTribeSnapshot

func NewTribeSnapshot(tb TestingTB, opts ...func(cfg *TribeSnapshotConfig)) domain.TribeSnapshot

func NewTribeSnapshotCursor

func NewTribeSnapshotCursor(tb TestingTB, opts ...func(cfg *TribeSnapshotCursorConfig)) domain.TribeSnapshotCursor

func NewTribeSnapshotWithRelations

func NewTribeSnapshotWithRelations(
	tb TestingTB,
	opts ...func(cfg *TribeSnapshotWithRelationsConfig),
) domain.TribeSnapshotWithRelations

func NewTribeWithRelations added in v1.8.0

func NewTribeWithRelations(tb TestingTB, opts ...func(cfg *TribeWithRelationsConfig)) domain.TribeWithRelations

func NewUnitInfo

func NewUnitInfo(tb TestingTB) domain.UnitInfo

func NewVersion

func NewVersion(tb TestingTB, opts ...func(cfg *VersionConfig)) domain.Version

func NewVersionCursor

func NewVersionCursor(tb TestingTB, opts ...func(cfg *VersionCursorConfig)) domain.VersionCursor

func NewVillage

func NewVillage(tb TestingTB, opts ...func(cfg *VillageConfig)) domain.Village

func NewVillageCursor

func NewVillageCursor(tb TestingTB, opts ...func(cfg *VillageCursorConfig)) domain.VillageCursor

func NewVillageWithRelations

func NewVillageWithRelations(tb TestingTB, opts ...func(cfg *VillageWithRelationsConfig)) domain.VillageWithRelations

func RandID

func RandID() int

func RandServerKey

func RandServerKey() string

func RandTribeTag

func RandTribeTag() string

func RandVersionCode

func RandVersionCode() string

Types

type BaseEnnoblementConfig

type BaseEnnoblementConfig struct {
	VillageID int
}

type BasePlayerConfig

type BasePlayerConfig struct {
	ID          int
	OD          domain.OpponentsDefeated
	NumVillages int
	AllPoints   int
	Rank        int
	TribeID     int
}

type BaseServerConfig

type BaseServerConfig struct {
	Key  string
	URL  *url.URL
	Open bool
}

type BaseTribeConfig

type BaseTribeConfig struct {
	ID          int
	Tag         string
	OD          domain.OpponentsDefeated
	NumVillages int
	AllPoints   int
	Rank        int
}

type BaseVillageConfig

type BaseVillageConfig struct {
	ID       int
	Bonus    int
	PlayerID int
}

type CleanUpDataCmdPayloadConfig

type CleanUpDataCmdPayloadConfig struct {
	ServerOptions []func(cfg *ServerConfig)
}

type EnnoblementConfig

type EnnoblementConfig struct {
	ID        int
	ServerKey string
	VillageID int
}

type EnnoblementCursorConfig

type EnnoblementCursorConfig struct {
	ID        int
	ServerKey string
	CreatedAt time.Time
}

type EnnoblementWithRelationsConfig

type EnnoblementWithRelationsConfig struct {
	EnnoblementOptions []func(cfg *EnnoblementConfig)
	VillageOptions     []func(cfg *VillageConfig)
	NewOwnerOptions    []func(cfg *PlayerConfig)
	NewTribeOptions    []func(cfg *TribeConfig)
	OldOwnerOptions    []func(cfg *PlayerConfig)
	OldTribeOptions    []func(cfg *TribeConfig)
}

type OpponentsDefeatedConfig

type OpponentsDefeatedConfig struct {
	ScoreAtt int
}

type PlayerConfig

type PlayerConfig struct {
	ID             int
	Points         int
	NumVillages    int
	ServerKey      string
	TribeID        int
	OD             domain.OpponentsDefeated
	BestRank       int
	BestRankAt     time.Time
	MostPoints     int
	MostPointsAt   time.Time
	MostVillages   int
	MostVillagesAt time.Time
	LastActivityAt time.Time
	DeletedAt      time.Time
}

type PlayerCursorConfig

type PlayerCursorConfig struct {
	ID           int
	ServerKey    string
	ODScoreAtt   int
	ODScoreDef   int
	ODScoreSup   int
	ODScoreTotal int
	Points       int
	MostPoints   int
	DeletedAt    time.Time
}

type PlayerSnapshotConfig

type PlayerSnapshotConfig struct {
	ID          int
	PlayerID    int
	ServerKey   string
	NumVillages int
	Points      int
	Rank        int
	TribeID     int
	OD          domain.OpponentsDefeated
	Date        time.Time
	CreatedAt   time.Time
}

type PlayerSnapshotCursorConfig

type PlayerSnapshotCursorConfig struct {
	ID        int
	ServerKey string
	Date      time.Time
}

type PlayerSnapshotWithRelationsConfig

type PlayerSnapshotWithRelationsConfig struct {
	PlayerSnapshotOptions []func(cfg *PlayerSnapshotConfig)
	PlayerOptions         []func(cfg *PlayerConfig)
	TribeOptions          []func(cfg *TribeConfig)
}

type PlayerWithRelationsConfig

type PlayerWithRelationsConfig struct {
	ServerOptions []func(cfg *ServerConfig)
	PlayerOptions []func(cfg *PlayerConfig)
	TribeOptions  []func(cfg *TribeConfig)
}

type ServerConfig

type ServerConfig struct {
	Key                      string
	VersionCode              string
	URL                      *url.URL
	Open                     bool
	Special                  bool
	PlayerDataSyncedAt       time.Time
	PlayerSnapshotsCreatedAt time.Time
	TribeDataSyncedAt        time.Time
	TribeSnapshotsCreatedAt  time.Time
	VillageDataSyncedAt      time.Time
	EnnoblementDataSyncedAt  time.Time
}

type ServerCursorConfig

type ServerCursorConfig struct {
	Key  string
	Open bool
}

type ServerSnapshotConfig added in v1.1.0

type ServerSnapshotConfig struct {
	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
}

type ServerSnapshotCursorConfig added in v1.1.0

type ServerSnapshotCursorConfig struct {
	ID        int
	ServerKey string
	Date      time.Time
}

type ServerSnapshotWithRelationsConfig added in v1.3.0

type ServerSnapshotWithRelationsConfig struct {
	ServerSnapshotOptions []func(cfg *ServerSnapshotConfig)
	ServerOptions         []func(cfg *ServerConfig)
}

type TestingTB

type TestingTB interface {
	Helper()
	Errorf(format string, args ...any)
	FailNow()
	Cleanup(f func())
}

TestingTB is a subset of the API provided by both *testing.T and *testing.B.

type TribeChangeConfig

type TribeChangeConfig struct {
	ID         int
	ServerKey  string
	PlayerID   int
	OldTribeID int
	NewTribeID int
	CreatedAt  time.Time
}

type TribeChangeCursorConfig

type TribeChangeCursorConfig struct {
	ID        int
	ServerKey string
	CreatedAt time.Time
}

type TribeChangeWithRelationsConfig

type TribeChangeWithRelationsConfig struct {
	TribeChangeOptions []func(cfg *TribeChangeConfig)
	PlayerOptions      []func(cfg *PlayerConfig)
	OldTribeOptions    []func(cfg *TribeConfig)
	NewTribeOptions    []func(cfg *TribeConfig)
}

type TribeConfig

type TribeConfig struct {
	ID             int
	ServerKey      string
	Tag            string
	OD             domain.OpponentsDefeated
	BestRank       int
	BestRankAt     time.Time
	MostPoints     int
	MostPointsAt   time.Time
	MostVillages   int
	MostVillagesAt time.Time
	DeletedAt      time.Time
}

type TribeCursorConfig

type TribeCursorConfig struct {
	ID           int
	ServerKey    string
	ODScoreAtt   int
	ODScoreDef   int
	ODScoreTotal int
	Points       int
	MostPoints   int
	Dominance    float64
	DeletedAt    time.Time
}

type TribeSnapshotConfig

type TribeSnapshotConfig struct {
	ID          int
	TribeID     int
	ServerKey   string
	NumMembers  int
	NumVillages int
	Points      int
	AllPoints   int
	Rank        int
	OD          domain.OpponentsDefeated
	Dominance   float64
	Date        time.Time
	CreatedAt   time.Time
}

type TribeSnapshotCursorConfig

type TribeSnapshotCursorConfig struct {
	ID        int
	ServerKey string
	Date      time.Time
}

type TribeSnapshotWithRelationsConfig

type TribeSnapshotWithRelationsConfig struct {
	TribeSnapshotOptions []func(cfg *TribeSnapshotConfig)
	TribeOptions         []func(cfg *TribeConfig)
}

type TribeWithRelationsConfig added in v1.8.0

type TribeWithRelationsConfig struct {
	ServerOptions []func(cfg *ServerConfig)
	TribeOptions  []func(cfg *TribeConfig)
}

type VersionConfig

type VersionConfig struct {
	Code string
}

type VersionCursorConfig

type VersionCursorConfig struct {
	Code string
}

type VillageConfig

type VillageConfig struct {
	ID        int
	ServerKey string
	X         int
	Y         int
	PlayerID  int
}

type VillageCursorConfig

type VillageCursorConfig struct {
	ID        int
	ServerKey string
}

type VillageWithRelationsConfig

type VillageWithRelationsConfig struct {
	VillageOptions []func(cfg *VillageConfig)
	PlayerOptions  []func(cfg *PlayerWithRelationsConfig)
}

Jump to

Keyboard shortcuts

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