categories

package
v0.0.0-...-3ce5cd6 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ListCategoriesOKCode int = 200

ListCategoriesOKCode is the HTTP code returned for type ListCategoriesOK

View Source
const ListProductsOfCategoryOKCode int = 200

ListProductsOfCategoryOKCode is the HTTP code returned for type ListProductsOfCategoryOK

Variables

This section is empty.

Functions

This section is empty.

Types

type ListCategories

type ListCategories struct {
	Context *middleware.Context
	Handler ListCategoriesHandler
}

ListCategories swagger:route GET /categories categories listCategories

List available categories

func NewListCategories

func NewListCategories(ctx *middleware.Context, handler ListCategoriesHandler) *ListCategories

NewListCategories creates a new http.Handler for the list categories operation

func (*ListCategories) ServeHTTP

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

type ListCategoriesDefault

type ListCategoriesDefault struct {

	/*
	  In: Body
	*/
	Payload *models.Error `json:"body,omitempty"`
	// contains filtered or unexported fields
}

ListCategoriesDefault generic error response

swagger:response listCategoriesDefault

func NewListCategoriesDefault

func NewListCategoriesDefault(code int) *ListCategoriesDefault

NewListCategoriesDefault creates ListCategoriesDefault with default headers values

func (*ListCategoriesDefault) SetPayload

func (o *ListCategoriesDefault) SetPayload(payload *models.Error)

SetPayload sets the payload to the list categories default response

func (*ListCategoriesDefault) SetStatusCode

func (o *ListCategoriesDefault) SetStatusCode(code int)

SetStatusCode sets the status to the list categories default response

func (*ListCategoriesDefault) WithPayload

func (o *ListCategoriesDefault) WithPayload(payload *models.Error) *ListCategoriesDefault

WithPayload adds the payload to the list categories default response

func (*ListCategoriesDefault) WithStatusCode

func (o *ListCategoriesDefault) WithStatusCode(code int) *ListCategoriesDefault

WithStatusCode adds the status to the list categories default response

func (*ListCategoriesDefault) WriteResponse

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

WriteResponse to the client

type ListCategoriesHandler

type ListCategoriesHandler interface {
	Handle(ListCategoriesParams) middleware.Responder
}

ListCategoriesHandler interface for that can handle valid list categories params

type ListCategoriesHandlerFunc

type ListCategoriesHandlerFunc func(ListCategoriesParams) middleware.Responder

ListCategoriesHandlerFunc turns a function with the right signature into a list categories handler

func (ListCategoriesHandlerFunc) Handle

Handle executing the request and returning a response

type ListCategoriesOK

type ListCategoriesOK struct {

	/*
	  In: Body
	*/
	Payload []*models.Category `json:"body,omitempty"`
}

ListCategoriesOK list the categories

swagger:response listCategoriesOK

func NewListCategoriesOK

func NewListCategoriesOK() *ListCategoriesOK

NewListCategoriesOK creates ListCategoriesOK with default headers values

func (*ListCategoriesOK) SetPayload

func (o *ListCategoriesOK) SetPayload(payload []*models.Category)

SetPayload sets the payload to the list categories o k response

func (*ListCategoriesOK) WithPayload

func (o *ListCategoriesOK) WithPayload(payload []*models.Category) *ListCategoriesOK

WithPayload adds the payload to the list categories o k response

func (*ListCategoriesOK) WriteResponse

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

WriteResponse to the client

type ListCategoriesParams

type ListCategoriesParams struct {

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

ListCategoriesParams contains all the bound params for the list categories operation typically these are obtained from a http.Request

swagger:parameters listCategories

func NewListCategoriesParams

func NewListCategoriesParams() ListCategoriesParams

NewListCategoriesParams creates a new ListCategoriesParams object no default values defined in spec.

func (*ListCategoriesParams) BindRequest

func (o *ListCategoriesParams) 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 NewListCategoriesParams() beforehand.

type ListCategoriesURL

type ListCategoriesURL struct {
	// contains filtered or unexported fields
}

ListCategoriesURL generates an URL for the list categories operation

func (*ListCategoriesURL) Build

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

Build a url path and query string

func (*ListCategoriesURL) BuildFull

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

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

func (*ListCategoriesURL) Must

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

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

func (*ListCategoriesURL) SetBasePath

func (o *ListCategoriesURL) 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 (*ListCategoriesURL) String

func (o *ListCategoriesURL) String() string

String returns the string representation of the path with query string

func (*ListCategoriesURL) StringFull

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

StringFull returns the string representation of a complete url

func (*ListCategoriesURL) WithBasePath

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

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

type ListProductsOfCategory

type ListProductsOfCategory struct {
	Context *middleware.Context
	Handler ListProductsOfCategoryHandler
}

ListProductsOfCategory swagger:route GET /categories/{category_id}/products categories listProductsOfCategory

List Products of a category

func NewListProductsOfCategory

func NewListProductsOfCategory(ctx *middleware.Context, handler ListProductsOfCategoryHandler) *ListProductsOfCategory

NewListProductsOfCategory creates a new http.Handler for the list products of category operation

func (*ListProductsOfCategory) ServeHTTP

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

type ListProductsOfCategoryDefault

type ListProductsOfCategoryDefault struct {

	/*
	  In: Body
	*/
	Payload *models.Error `json:"body,omitempty"`
	// contains filtered or unexported fields
}

ListProductsOfCategoryDefault generic error response

swagger:response listProductsOfCategoryDefault

func NewListProductsOfCategoryDefault

func NewListProductsOfCategoryDefault(code int) *ListProductsOfCategoryDefault

NewListProductsOfCategoryDefault creates ListProductsOfCategoryDefault with default headers values

func (*ListProductsOfCategoryDefault) SetPayload

func (o *ListProductsOfCategoryDefault) SetPayload(payload *models.Error)

SetPayload sets the payload to the list products of category default response

func (*ListProductsOfCategoryDefault) SetStatusCode

func (o *ListProductsOfCategoryDefault) SetStatusCode(code int)

SetStatusCode sets the status to the list products of category default response

func (*ListProductsOfCategoryDefault) WithPayload

WithPayload adds the payload to the list products of category default response

func (*ListProductsOfCategoryDefault) WithStatusCode

WithStatusCode adds the status to the list products of category default response

func (*ListProductsOfCategoryDefault) WriteResponse

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

WriteResponse to the client

type ListProductsOfCategoryHandler

type ListProductsOfCategoryHandler interface {
	Handle(ListProductsOfCategoryParams) middleware.Responder
}

ListProductsOfCategoryHandler interface for that can handle valid list products of category params

type ListProductsOfCategoryHandlerFunc

type ListProductsOfCategoryHandlerFunc func(ListProductsOfCategoryParams) middleware.Responder

ListProductsOfCategoryHandlerFunc turns a function with the right signature into a list products of category handler

func (ListProductsOfCategoryHandlerFunc) Handle

Handle executing the request and returning a response

type ListProductsOfCategoryOK

type ListProductsOfCategoryOK struct {

	/*
	  In: Body
	*/
	Payload []*models.Product `json:"body,omitempty"`
}

ListProductsOfCategoryOK list the products of selected category

swagger:response listProductsOfCategoryOK

func NewListProductsOfCategoryOK

func NewListProductsOfCategoryOK() *ListProductsOfCategoryOK

NewListProductsOfCategoryOK creates ListProductsOfCategoryOK with default headers values

func (*ListProductsOfCategoryOK) SetPayload

func (o *ListProductsOfCategoryOK) SetPayload(payload []*models.Product)

SetPayload sets the payload to the list products of category o k response

func (*ListProductsOfCategoryOK) WithPayload

WithPayload adds the payload to the list products of category o k response

func (*ListProductsOfCategoryOK) WriteResponse

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

WriteResponse to the client

type ListProductsOfCategoryParams

type ListProductsOfCategoryParams struct {

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

	/*
	  Required: true
	  In: path
	*/
	CategoryID int64
	/*
	  In: query
	  Default: 20
	*/
	Limit *int32
	/*
	  In: query
	  Default: 0
	*/
	Since *int64
}

ListProductsOfCategoryParams contains all the bound params for the list products of category operation typically these are obtained from a http.Request

swagger:parameters listProductsOfCategory

func NewListProductsOfCategoryParams

func NewListProductsOfCategoryParams() ListProductsOfCategoryParams

NewListProductsOfCategoryParams creates a new ListProductsOfCategoryParams object with the default values initialized.

func (*ListProductsOfCategoryParams) BindRequest

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 NewListProductsOfCategoryParams() beforehand.

type ListProductsOfCategoryURL

type ListProductsOfCategoryURL struct {
	CategoryID int64

	Limit *int32
	Since *int64
	// contains filtered or unexported fields
}

ListProductsOfCategoryURL generates an URL for the list products of category operation

func (*ListProductsOfCategoryURL) Build

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

Build a url path and query string

func (*ListProductsOfCategoryURL) BuildFull

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

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

func (*ListProductsOfCategoryURL) Must

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

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

func (*ListProductsOfCategoryURL) SetBasePath

func (o *ListProductsOfCategoryURL) 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 (*ListProductsOfCategoryURL) String

func (o *ListProductsOfCategoryURL) String() string

String returns the string representation of the path with query string

func (*ListProductsOfCategoryURL) StringFull

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

StringFull returns the string representation of a complete url

func (*ListProductsOfCategoryURL) WithBasePath

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