domain

package
v0.0.0-...-faa9808 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Battle

type Battle struct {
	ID        int      `json:"id"`
	StartedAt int64    `json:"started_at"`
	EndedAt   int64    `json:"ended_at"`
	Players   []Player `json:"players"`
	Logs      []Log    `json:"logs"`
}

type BattleEntity

type BattleEntity struct {
	ID        int
	StartedAt int64
	EndedAt   int64
	Players   string
	Logs      string
}

type DreamWorld

type DreamWorld struct {
	FrontDefault string `json:"front_default"`
}

type FindWith

type FindWith int
const (
	FindWithID FindWith = iota
	FindWithRelationID
	FindWithName
)

type IBattleRepository

type IBattleRepository interface {
	ICreateRepository[Battle]
	IReadAllRepository[Battle]
	ICountRowRepository
}

type ICountRowRepository

type ICountRowRepository interface {
	Count(ctx context.Context) int
}

type ICreateBulkRepository

type ICreateBulkRepository[T any] interface {
	Create(ctx context.Context, param []*T) error
}

ICreateBulkRepository - Bulk Create

type ICreateRepository

type ICreateRepository[T any] interface {
	Create(ctx context.Context, param *T) error
}

ICreateRepository - Create

type IDeleteRepository

type IDeleteRepository[T any] interface {
	Delete(ctx context.Context, param *T) error
}

IDeleteRepository - Delete

type IMonsterRepository

type IMonsterRepository interface {
	ICreateBulkRepository[Monster]
	IReadAllRepository[Monster]
	IUpdateRepository[Monster]
	ICountRowRepository
}

type IPokeapiRESTRepository

type IPokeapiRESTRepository interface {
	Pokemon(ctx context.Context, offset, limit int) ([]*Monster, error)
}

type IPokewarService

type IPokewarService interface {
	MonstersCount() int
	FetchMonsters(args ...string) (data []*Monster, err *utils.ServiceError)
	SyncMonsters(updateEnv bool, args ...string) (data []*Monster, err *utils.ServiceError)

	FetchRanks(args ...string) (data []*Rank, err *utils.ServiceError)

	BattlesCount() int
	FetchBattles(args ...string) (data []*Battle, err *utils.ServiceError)
	PrepareMonstersForBattle() (data []*Monster, err *utils.ServiceError)
	AddBattle(param *Battle) *utils.ServiceError
}

type IRankRepository

type IRankRepository interface {
	IReadAllRepository[Rank]
}

type IReadAllRepository

type IReadAllRepository[T any] interface {
	All(ctx context.Context, args ...string) (data []*T, err error)
}

IReadAllRepository - ReadAllNoCondition (args: LIMIT, OFFSET, OR WHERE CLAUSE)

type IReadOneRepository

type IReadOneRepository[T any] interface {
	Find(ctx context.Context, key FindWith, val any) (data *T, err error)
}

IReadOneRepository - ReadOne/Show

type IUpdateRepository

type IUpdateRepository[T any] interface {
	Update(ctx context.Context, param *T) error
}

IUpdateRepository - Update

type Log

type Log struct {
	ID          int    `json:"id"`
	BattleID    int    `json:"battle_id"`
	Description string `json:"description"`
	CreatedAt   int64  `json:"created_at"`
}

type Monster

type Monster struct {
	ID       int      `json:"id"`
	OriginID int      `json:"origin_id"`
	Name     string   `json:"name"`
	BaseExp  int      `json:"base_exp"`
	Height   int      `json:"height"`
	Weight   int      `json:"weight"`
	Avatar   string   `json:"avatar"`
	Types    []string `json:"types"`
	Stats    []Stat   `json:"stats"`
	Skills   []*Skill `json:"skills"`
}

type MonsterEntity

type MonsterEntity struct {
	ID       int
	OriginID int
	Name     string
	BaseExp  int
	Height   int
	Weight   int
	Avatar   string
	Types    string
	Stats    string
	Skills   string
}

type Move

type Move struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

type Moves

type Moves struct {
	Move Move `json:"move"`
}

type Other

type Other struct {
	DreamWorld DreamWorld `json:"dream_world"`
}

type Player

type Player struct {
	ID           int    `json:"id"`
	Name         string `json:"name"`
	Avatar       string `json:"avatar"`
	BattleID     int    `json:"battle_id"`
	MonsterID    int    `json:"monster_id"`
	EliminatedAt int64  `json:"eliminated_at"`
	AnnulledAt   int64  `json:"annulled_at"`
	Rank         int    `json:"rank"`
	Point        int    `json:"point"`
}

type Pokemon

type Pokemon struct {
	ID             int     `json:"id"`
	Name           string  `json:"name"`
	Height         int     `json:"height"`
	Weight         int     `json:"weight"`
	BaseExperience int     `json:"base_experience"`
	Sprites        Sprites `json:"sprites"`
	Types          []Types `json:"types"`
	Stats          []Stats `json:"stats"`
	Moves          []Moves `json:"moves"`
}

type PokemonResult

type PokemonResult struct {
	Count    int              `json:"count"`
	Next     string           `json:"next"`
	Previous interface{}      `json:"previous"`
	Results  []PokemonSummary `json:"results"`
}

type PokemonSummary

type PokemonSummary struct {
	Name string `json:"name"`
	URL  string `json:"url"`
}

type Rank

type Rank struct {
	ID           int      `json:"id"`
	OriginID     int      `json:"origin_id"`
	Name         string   `json:"name"`
	Avatar       string   `json:"avatar"`
	T            string   `json:"-"`
	Types        []string `json:"types"`
	TotalBattles int      `json:"total_battles"`
	WinBattles   int      `json:"win_battles"`
	LoseBattle   int      `json:"lose_battles"`
	Points       int      `json:"points"`
}

type Skill

type Skill struct {
	PP   int    `json:"pp"` // Power Points
	Name string `json:"name"`
}

type Sprites

type Sprites struct {
	Other Other `json:"other"`
}

type Stat

type Stat struct {
	BaseStat int    `json:"base_stat"`
	Name     string `json:"name"`
}

type Stats

type Stats struct {
	BaseStat int  `json:"base_stat"`
	Stat     Stat `json:"stat"`
}

type Type

type Type struct {
	Name string `json:"name"`
}

type Types

type Types struct {
	Type Type `json:"type"`
}

Jump to

Keyboard shortcuts

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