book_id

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2020 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
const BookIDBadRequestCode int = 400

BookIDBadRequestCode is the HTTP code returned for type BookIDBadRequest

View Source
const BookIDOKCode int = 200

BookIDOKCode is the HTTP code returned for type BookIDOK

Variables

This section is empty.

Functions

This section is empty.

Types

type BookID

type BookID struct {
	Context *middleware.Context
	Handler BookIDHandler
}

BookID swagger:route GET /book/id/{id} bookID bookId

Handler for seek book on id

func NewBookID

func NewBookID(ctx *middleware.Context, handler BookIDHandler) *BookID

NewBookID creates a new http.Handler for the book ID operation

func (*BookID) ServeHTTP

func (o *BookID) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type BookIDBadRequest

type BookIDBadRequest struct {

	/*
	  In: Body
	*/
	Payload *models.Fail `json:"body,omitempty"`
}

BookIDBadRequest Bad request

swagger:response bookIdBadRequest

func NewBookIDBadRequest

func NewBookIDBadRequest() *BookIDBadRequest

NewBookIDBadRequest creates BookIDBadRequest with default headers values

func (*BookIDBadRequest) SetPayload

func (o *BookIDBadRequest) SetPayload(payload *models.Fail)

SetPayload sets the payload to the book Id bad request response

func (*BookIDBadRequest) WithPayload

func (o *BookIDBadRequest) WithPayload(payload *models.Fail) *BookIDBadRequest

WithPayload adds the payload to the book Id bad request response

func (*BookIDBadRequest) WriteResponse

func (o *BookIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type BookIDHandler

type BookIDHandler interface {
	Handle(BookIDParams) middleware.Responder
}

BookIDHandler interface for that can handle valid book ID params

type BookIDHandlerFunc

type BookIDHandlerFunc func(BookIDParams) middleware.Responder

BookIDHandlerFunc turns a function with the right signature into a book ID handler

func (BookIDHandlerFunc) Handle

Handle executing the request and returning a response

type BookIDOK

type BookIDOK struct {

	/*
	  In: Body
	*/
	Payload *models.Book `json:"body,omitempty"`
}

BookIDOK Successful response

swagger:response bookIdOK

func NewBookIDOK

func NewBookIDOK() *BookIDOK

NewBookIDOK creates BookIDOK with default headers values

func (*BookIDOK) SetPayload

func (o *BookIDOK) SetPayload(payload *models.Book)

SetPayload sets the payload to the book Id o k response

func (*BookIDOK) WithPayload

func (o *BookIDOK) WithPayload(payload *models.Book) *BookIDOK

WithPayload adds the payload to the book Id o k response

func (*BookIDOK) WriteResponse

func (o *BookIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type BookIDParams

type BookIDParams struct {

	// HTTP Request Object
	HTTPRequest *http.Request `json:"-"`

	/*The ID of book.
	  Required: true
	  Minimum: 1
	  In: path
	*/
	ID int64
}

BookIDParams contains all the bound params for the book ID operation typically these are obtained from a http.Request

swagger:parameters bookID

func NewBookIDParams

func NewBookIDParams() BookIDParams

NewBookIDParams creates a new BookIDParams object no default values defined in spec.

func (*BookIDParams) BindRequest

func (o *BookIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error

BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.

To ensure default values, the struct must have been initialized with NewBookIDParams() beforehand.

type BookIDURL

type BookIDURL struct {
	ID int64
	// contains filtered or unexported fields
}

BookIDURL generates an URL for the book ID operation

func (*BookIDURL) Build

func (o *BookIDURL) Build() (*url.URL, error)

Build a url path and query string

func (*BookIDURL) BuildFull

func (o *BookIDURL) BuildFull(scheme, host string) (*url.URL, error)

BuildFull builds a full url with scheme, host, path and query string

func (*BookIDURL) Must

func (o *BookIDURL) Must(u *url.URL, err error) *url.URL

Must is a helper function to panic when the url builder returns an error

func (*BookIDURL) SetBasePath

func (o *BookIDURL) SetBasePath(bp string)

SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

func (*BookIDURL) String

func (o *BookIDURL) String() string

String returns the string representation of the path with query string

func (*BookIDURL) StringFull

func (o *BookIDURL) StringFull(scheme, host string) string

StringFull returns the string representation of a complete url

func (*BookIDURL) WithBasePath

func (o *BookIDURL) WithBasePath(bp string) *BookIDURL

WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

Jump to

Keyboard shortcuts

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