go-swagger: github.com/go-swagger/go-swagger/fixtures/goparsing/petstore/rest/handlers Index | Files

package handlers

import "github.com/go-swagger/go-swagger/fixtures/goparsing/petstore/rest/handlers"

Index

Package Files

orders.go pets.go users.go

func CancelOrder Uses

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 Uses

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 Uses

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 Uses

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

CreateUser creates a user

func DeletePet Uses

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 Uses

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

DeleteUser deletes a user from the store

func GetHelp Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

GetUserByID gets a user by id

func GetUsers Uses

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

GetUsers handles the list users operation

func UpdateOrder Uses

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 Uses

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 Uses

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

UpdateUser updates a user

type GenericError Uses

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 Uses

type MarkdownRender string

MarkdownRender is a rendered markdown document swagger:response MarkdownRender

type OrderBodyParams Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

Package handlers imports 4 packages (graph) and is imported by 9 packages. Updated 2019-08-22. Refresh now. Tools for package owners.