Documentation ¶
Index ¶
- func RegisterRoutes(e *echo.Echo, db *pg.DB, nonEnforceAuth echo.MiddlewareFunc)
- type Evolution
- type EvolutionFamily
- type EvolutionPokemon
- type ListPokemonOptions
- type Location
- type Pokemon
- type RetrieveEvolutionFamilyOptions
- type RetrievePokemonOptions
- type Service
- func (svc *Service) ListPokemon(ctx context.Context, opts ListPokemonOptions) ([]*Pokemon, error)
- func (svc *Service) RetrieveEvolutionFamily(ctx context.Context, opts RetrieveEvolutionFamilyOptions) (*EvolutionFamily, error)
- func (svc *Service) RetrievePokemon(ctx context.Context, opts RetrievePokemonOptions) (*Pokemon, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
func RegisterRoutes(e *echo.Echo, db *pg.DB, nonEnforceAuth echo.MiddlewareFunc)
RegisterRoutes takes in an Echo router and registers routes onto it.
Types ¶
type Evolution ¶
type Evolution struct { EvolvingPokemonID int `json:"-"` EvolvingPokemon *EvolutionPokemon `pg:"evolving,rel:has-one" json:"-"` EvolvedPokemonID int `json:"-"` EvolvedPokemon *EvolutionPokemon `pg:"evolved,rel:has-one" json:"-"` EvolutionFamilyID int `json:"-"` Stage int `json:"-"` Trigger string `json:"trigger"` Level *int `json:"level,omitempty"` CandyCount *int `json:"candy_count,omitempty"` Stone *string `json:"stone,omitempty"` HeldItem *string `json:"held_item,omitempty"` Notes *string `json:"notes,omitempty"` DateCreated time.Time `json:"-"` DateModified time.Time `json:"-"` // contains filtered or unexported fields }
type EvolutionFamily ¶
type EvolutionFamily struct { Pokemon [][]*EvolutionPokemon `json:"pokemon"` Evolutions [][]*Evolution `json:"evolutions"` }
type EvolutionPokemon ¶
type ListPokemonOptions ¶
type ListPokemonOptions struct {
IDs []int
}
type Location ¶
type Location struct { GameID string `json:"-"` Game *games.Game `pg:"g,rel:has-one" json:"game"` PokemonID int `json:"-"` Value string `json:"value"` Values []string `pg:",array" json:"values"` // contains filtered or unexported fields }
func (*Location) MarshalJSON ¶
MarshalJSON is just needed for parity testing. Once we're actually using this in production, we can remove it.
type Pokemon ¶
type Pokemon struct { ID int `json:"id"` NationalID int `json:"national_id"` Name string `json:"name"` GameFamilyID string `json:"-"` GameFamily *games.GameFamily `pg:"gf,rel:has-one" json:"game_family"` Form *string `json:"form"` Box *string `pg:"-" json:"box"` DexNumber int `pg:"-" json:"dex_number"` Locations []*Location `pg:"l,rel:has-many" json:"locations"` NationalOrder int `json:"-"` EvolutionFamilyID int `json:"-"` EvolutionFamily *EvolutionFamily `pg:"-" json:"evolution_family"` DateCreated time.Time `json:"-"` DateModified time.Time `json:"-"` // contains filtered or unexported fields }
type RetrievePokemonOptions ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(db *pg.DB) *Service
func (*Service) ListPokemon ¶
func (*Service) RetrieveEvolutionFamily ¶
func (svc *Service) RetrieveEvolutionFamily(ctx context.Context, opts RetrieveEvolutionFamilyOptions) (*EvolutionFamily, error)
func (*Service) RetrievePokemon ¶
Click to show internal directories.
Click to hide internal directories.