pokemon

package
v0.0.0-...-7fe3c21 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectionResource

func CollectionResource(w http.ResponseWriter, r *http.Request)

func Cors

func Cors(w http.ResponseWriter, r *http.Request)

func CreateMemberDao

func CreateMemberDao(body Pokemon) error

func DeleteMember

func DeleteMember(w http.ResponseWriter, r *http.Request)

func DeleteMemberDao

func DeleteMemberDao(name string) error

func GetCollection

func GetCollection(w http.ResponseWriter, r *http.Request)

func GetMember

func GetMember(w http.ResponseWriter, r *http.Request)

func MemberResource

func MemberResource(w http.ResponseWriter, r *http.Request)

func PostCollection

func PostCollection(w http.ResponseWriter, r *http.Request)

func PutMember

func PutMember(w http.ResponseWriter, r *http.Request)

func UpdateMemberDao

func UpdateMemberDao(name string, body map[string]interface{}) error

Types

type BaseStats

type BaseStats struct {
	Hp             int `bson:"hp" json:"hp"`
	Attack         int `bson:"attack" json:"attack"`
	Defense        int `bson:"defense" json:"defense"`
	SpecialAttack  int `bson:"specialAttack" json:"specialAttack"`
	SpecialDefence int `bson:"specialDefense" json:"specialDefense"`
	Speed          int `bson:"speed" json:"speed"`
}

type CollectionResponse

type CollectionResponse struct {
	Code int      `json:"code"`
	Msg  string   `json:"msg"`
	Body Pokemons `json:"body"`
}

func CollectionService

func CollectionService() CollectionResponse

func PostCollectionService

func PostCollectionService(body Pokemon) CollectionResponse

type Evolution

type Evolution struct {
	Level  int    `bson:"level" json:"level"`
	Name   string `bson:"name" json:"name"`
	Number int    `bson:"number" json:"number"`
}

type Pokemon

type Pokemon struct {
	Name           string                 `bson:"name" json:"name"`
	Number         int                    `bson:"number" json:"number"`
	Generation     string                 `bson:"generation" json:"generation"`
	Types          []string               `bson:"types" json:"types"`
	BaseStats      BaseStats              `bson:"baseStats" json:"baseStats"`
	Genus          string                 `bson:"genus" json:"genus"`
	Height         int                    `bson:"height" json:"height"`
	Weight         int                    `bson:"weight" json:"weight"`
	CaptureRate    int                    `bson:"captureRate" json:"captureRate"`
	BaseExperience int                    `bson:"baseExperience" json:"baseExperience"`
	Abilities      []string               `bson:"abilities" json:"abilities"`
	EffortValues   map[string]interface{} `bson:"effortValues" json:"effortValues"`
	EggGroups      []string               `bson:"eggGroups" json:"eggGroups"`
	Evolution      Evolution              `bson:"evolution" json:"evolution"`
}

func MemberDao

func MemberDao(name string) (Pokemon, error)

type Pokemons

type Pokemons struct {
	Pokemons []Pokemon `json:"pokemon"`
}

func CollectionDao

func CollectionDao() (Pokemons, error)

type Response

type Response struct {
	Code int     `json:"code"`
	Msg  string  `json:"msg"`
	Body Pokemon `json:"body"`
}

func DeleteMemberService

func DeleteMemberService(name string) Response

func MemberService

func MemberService(name string) Response

func PutMemberService

func PutMemberService(name string, body map[string]interface{}) Response

Jump to

Keyboard shortcuts

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