handlers

package
v0.22.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelOrder

func CancelOrder(rw http.ResponseWriter, req *http.Request, params denco.Params)

CancelOrder swagger:route DELETE /orders/{id} orders cancelOrder

Deletes an order.

Responses:

default: genericError
    204:

func CreateOrder

func CreateOrder(rw http.ResponseWriter, req *http.Request, params denco.Params)

CreateOrder swagger:route POST /orders orders createOrder

Creates an order.

Responses:

default: genericError
    200: orderResponse
    422: validationError

func CreatePet

func CreatePet(w http.ResponseWriter, r *http.Request, params denco.Params)

CreatePet swagger:route POST /pets pets createPet

Creates a new pet in the store.

Responses:

default: genericError
    200: pet
    422: validationError

func CreateUser

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

CreateUser creates a user

func DeletePet

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

DeletePet swagger:route DELETE /pets/{id} pets deletePet

Deletes a pet from the store.

Responses:

default: genericError
    204:

func DeleteUser

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

DeleteUser deletes a user from the store

func GetHelp added in v0.22.0

func GetHelp(rw http.ResponseWriter, req *http.Request, params denco.Params)

GetHelp swagger:route GET /help help

Gets the help as markdown

Responses:

default: genericError
    200: MarkdownRender
    422: validationError

func GetOrderDetails

func GetOrderDetails(rw http.ResponseWriter, req *http.Request, params denco.Params)

GetOrderDetails swagger:route GET /orders/{id} orders getOrderDetails

Gets the details for an order.

Responses:

default: genericError
    200: orderResponse

func GetPetByID

func GetPetByID(w http.ResponseWriter, r *http.Request, params denco.Params)

GetPetByID swagger:route GET /pets/{id} pets getPetById

Gets the details for a pet.

Responses:

default: genericError
    200: pet

func GetPets deprecated

func GetPets(w http.ResponseWriter, r *http.Request, params denco.Params)

GetPets swagger:route GET /pets pets listPets

Lists the pets known to the store.

By default it will only lists pets that are available for sale. This can be changed with the status flag.

Deprecated: true Responses:

default: genericError
    200: []pet

func GetUserByID

func GetUserByID(w http.ResponseWriter, r *http.Request, params denco.Params)

GetUserByID gets a user by id

func GetUsers

func GetUsers(w http.ResponseWriter, r *http.Request, params denco.Params)

GetUsers handles the list users operation

func UpdateOrder

func UpdateOrder(rw http.ResponseWriter, req *http.Request, params denco.Params)

UpdateOrder swagger:route PUT /orders/{id} orders updateOrder

Updates an order.

Responses:

default: genericError
    200: order
    422: validationError

func UpdatePet

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

UpdatePet swagger:route PUT /pets/{id} pets updatePet

Updates the details for a pet.

Responses:

default: genericError
    200: pet
    422: validationError

func UpdateUser

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

UpdateUser updates a user

Types

type GenericError

type GenericError struct {
	// in: body
	Body struct {
		Code    int32 `json:"code"`
		Message error `json:"message"`
	} `json:"body"`
}

A GenericError is the default error message that is generated. For certain status codes there are more appropriate error structures.

swagger:response genericError

type MarkdownRender added in v0.22.0

type MarkdownRender string

MarkdownRender is a rendered markdown document swagger:response MarkdownRender

type OrderBodyParams

type OrderBodyParams struct {
	// The order to submit
	//
	// required: true
	// in: body
	Order *models.Order `json:"order"`
}

An OrderBodyParams model.

This is used for operations that want an Order as body of the request swagger:parameters updateOrder createOrder

type OrderID

type OrderID struct {
	// The ID of the order
	//
	// in: path
	// required: true
	ID int64 `json:"id"`
}

An OrderID parameter model.

This is used for operations that want the ID of an order in the path swagger:parameters getOrderDetails cancelOrder updateOrder

type OrderResponse

type OrderResponse struct {
	// in: body
	Payload *models.Order `json:"order"`
}

An OrderResponse response model

This is used for returning a response with a single order as body

swagger:response orderResponse

type PetBodyParams

type PetBodyParams struct {
	// The pet to submit.
	//
	// in: body
	// required: true
	Pet *models.Pet `json:"pet"`
}

A PetBodyParams model.

This is used for operations that want an Order as body of the request swagger:parameters updatePet createPet

type PetID

type PetID struct {
	// The ID of the pet
	//
	// in: path
	// required: true
	ID int64 `json:"id"`
}

A PetID parameter model.

This is used for operations that want the ID of an pet in the path swagger:parameters getPetById deletePet updatePet

type PetQueryFlags

type PetQueryFlags struct {
	// Status
	Status string `json:"status"`

	// Birthday
	//
	// swagger:strfmt date
	Birthday time.Time `json:"birthday"`
}

A PetQueryFlags contains the query flags for things that list pets. swagger:parameters listPets

type ValidationError

type ValidationError struct {
	// in: body
	Body struct {
		Code    int32  `json:"code"`
		Message string `json:"message"`
		Field   string `json:"field"`
	} `json:"body"`
}

A ValidationError is an that is generated for validation failures. It has the same fields as a generic error but adds a Field property.

swagger:response validationError

Jump to

Keyboard shortcuts

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