petstoreserver

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

README

Go API Server for petstoreserver

This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on irc.freenode.net, #swagger. For this sample, you can use the api key special-key to test the authorization filters.

Overview

This server was generated by the [swagger-codegen] (https://github.com/swagger-api/swagger-codegen) project.
By using the OpenAPI-Spec from a remote server, you can easily generate a server stub.

To see how to make this your own, look here:

README

  • API version: 1.0.0
Running the server

To run the server, follow these simple steps:

go run main.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPet

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

func CreateUser

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

func CreateUsersWithArrayInput

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

func CreateUsersWithListInput

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

func DeleteOrder

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

func DeletePet

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

func DeleteUser

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

func FindPetsByStatus

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

func FindPetsByTags

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

func GetInventory

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

func GetOrderById

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

func GetPetById

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

func GetUserByName

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

func Index

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

func Logger

func Logger(inner http.Handler, name string) http.Handler

func LoginUser

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

func LogoutUser

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

func NewRouter

func NewRouter() *mux.Router

func PlaceOrder

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

func UpdatePet

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

func UpdatePetWithForm

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

func UpdateUser

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

func UploadFile

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

Types

type ApiResponse

type ApiResponse struct {
	Code int32 `json:"code,omitempty"`

	Type string `json:"type,omitempty"`

	Message string `json:"message,omitempty"`
}

Describes the result of uploading an image resource

type Category

type Category struct {
	Id int64 `json:"id,omitempty"`

	Name string `json:"name,omitempty"`
}

A category for a pet

type Order

type Order struct {
	Id int64 `json:"id,omitempty"`

	PetId int64 `json:"petId,omitempty"`

	Quantity int32 `json:"quantity,omitempty"`

	ShipDate time.Time `json:"shipDate,omitempty"`

	// Order Status
	Status string `json:"status,omitempty"`

	Complete bool `json:"complete,omitempty"`
}

An order for a pets from the pet store

type Pet

type Pet struct {
	Id int64 `json:"id,omitempty"`

	Category *Category `json:"category,omitempty"`

	Name string `json:"name"`

	PhotoUrls []string `json:"photoUrls"`

	Tags []Tag `json:"tags,omitempty"`

	// pet status in the store
	Status string `json:"status,omitempty"`
}

A pet for sale in the pet store

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

type Routes

type Routes []Route

type Tag

type Tag struct {
	Id int64 `json:"id,omitempty"`

	Name string `json:"name,omitempty"`
}

A tag for a pet

type User

type User struct {
	Id int64 `json:"id,omitempty"`

	Username string `json:"username,omitempty"`

	FirstName string `json:"firstName,omitempty"`

	LastName string `json:"lastName,omitempty"`

	Email string `json:"email,omitempty"`

	Password string `json:"password,omitempty"`

	Phone string `json:"phone,omitempty"`

	// User Status
	UserStatus int32 `json:"userStatus,omitempty"`
}

A User who is purchasing from the pet store

Jump to

Keyboard shortcuts

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