Documentation ¶
Index ¶
- Constants
- type AddOrder
- type AddOrderDefault
- func (o *AddOrderDefault) SetPayload(payload *models.Error)
- func (o *AddOrderDefault) SetStatusCode(code int)
- func (o *AddOrderDefault) WithPayload(payload *models.Error) *AddOrderDefault
- func (o *AddOrderDefault) WithStatusCode(code int) *AddOrderDefault
- func (o *AddOrderDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
- type AddOrderForbidden
- type AddOrderHandler
- type AddOrderHandlerFunc
- type AddOrderOK
- type AddOrderParams
- type AddOrderURL
- func (o *AddOrderURL) Build() (*url.URL, error)
- func (o *AddOrderURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *AddOrderURL) Must(u *url.URL, err error) *url.URL
- func (o *AddOrderURL) SetBasePath(bp string)
- func (o *AddOrderURL) String() string
- func (o *AddOrderURL) StringFull(scheme, host string) string
- func (o *AddOrderURL) WithBasePath(bp string) *AddOrderURL
- type AddOrderUnauthorized
- type GetAccount
- type GetAccountDefault
- func (o *GetAccountDefault) SetPayload(payload *models.Error)
- func (o *GetAccountDefault) SetStatusCode(code int)
- func (o *GetAccountDefault) WithPayload(payload *models.Error) *GetAccountDefault
- func (o *GetAccountDefault) WithStatusCode(code int) *GetAccountDefault
- func (o *GetAccountDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
- type GetAccountHandler
- type GetAccountHandlerFunc
- type GetAccountOK
- type GetAccountParams
- type GetAccountURL
- func (o *GetAccountURL) Build() (*url.URL, error)
- func (o *GetAccountURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *GetAccountURL) Must(u *url.URL, err error) *url.URL
- func (o *GetAccountURL) SetBasePath(bp string)
- func (o *GetAccountURL) String() string
- func (o *GetAccountURL) StringFull(scheme, host string) string
- func (o *GetAccountURL) WithBasePath(bp string) *GetAccountURL
- type GetAccountUnauthorized
- type GetItems
- type GetItemsDefault
- func (o *GetItemsDefault) SetPayload(payload *models.Error)
- func (o *GetItemsDefault) SetStatusCode(code int)
- func (o *GetItemsDefault) WithPayload(payload *models.Error) *GetItemsDefault
- func (o *GetItemsDefault) WithStatusCode(code int) *GetItemsDefault
- func (o *GetItemsDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
- type GetItemsHandler
- type GetItemsHandlerFunc
- type GetItemsOK
- type GetItemsParams
- type GetItemsURL
- func (o *GetItemsURL) Build() (*url.URL, error)
- func (o *GetItemsURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *GetItemsURL) Must(u *url.URL, err error) *url.URL
- func (o *GetItemsURL) SetBasePath(bp string)
- func (o *GetItemsURL) String() string
- func (o *GetItemsURL) StringFull(scheme, host string) string
- func (o *GetItemsURL) WithBasePath(bp string) *GetItemsURL
- type GetOrder
- type GetOrderDefault
- func (o *GetOrderDefault) SetPayload(payload *models.Error)
- func (o *GetOrderDefault) SetStatusCode(code int)
- func (o *GetOrderDefault) WithPayload(payload *models.Error) *GetOrderDefault
- func (o *GetOrderDefault) WithStatusCode(code int) *GetOrderDefault
- func (o *GetOrderDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
- type GetOrderForbidden
- type GetOrderHandler
- type GetOrderHandlerFunc
- type GetOrderOK
- type GetOrderParams
- type GetOrderURL
- func (o *GetOrderURL) Build() (*url.URL, error)
- func (o *GetOrderURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *GetOrderURL) Must(u *url.URL, err error) *url.URL
- func (o *GetOrderURL) SetBasePath(bp string)
- func (o *GetOrderURL) String() string
- func (o *GetOrderURL) StringFull(scheme, host string) string
- func (o *GetOrderURL) WithBasePath(bp string) *GetOrderURL
- type GetOrderUnauthorized
- type GetOrdersForItem
- type GetOrdersForItemDefault
- func (o *GetOrdersForItemDefault) SetPayload(payload *models.Error)
- func (o *GetOrdersForItemDefault) SetStatusCode(code int)
- func (o *GetOrdersForItemDefault) WithPayload(payload *models.Error) *GetOrdersForItemDefault
- func (o *GetOrdersForItemDefault) WithStatusCode(code int) *GetOrdersForItemDefault
- func (o *GetOrdersForItemDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
- type GetOrdersForItemForbidden
- type GetOrdersForItemHandler
- type GetOrdersForItemHandlerFunc
- type GetOrdersForItemOK
- type GetOrdersForItemParams
- type GetOrdersForItemURL
- func (o *GetOrdersForItemURL) Build() (*url.URL, error)
- func (o *GetOrdersForItemURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *GetOrdersForItemURL) Must(u *url.URL, err error) *url.URL
- func (o *GetOrdersForItemURL) SetBasePath(bp string)
- func (o *GetOrdersForItemURL) String() string
- func (o *GetOrdersForItemURL) StringFull(scheme, host string) string
- func (o *GetOrdersForItemURL) WithBasePath(bp string) *GetOrdersForItemURL
- type GetOrdersForItemUnauthorized
- type MultiAuthExampleAPI
- func (o *MultiAuthExampleAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *MultiAuthExampleAPI) Authorizer() runtime.Authorizer
- func (o *MultiAuthExampleAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *MultiAuthExampleAPI) Context() *middleware.Context
- func (o *MultiAuthExampleAPI) DefaultConsumes() string
- func (o *MultiAuthExampleAPI) DefaultProduces() string
- func (o *MultiAuthExampleAPI) Formats() strfmt.Registry
- func (o *MultiAuthExampleAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *MultiAuthExampleAPI) Init()
- func (o *MultiAuthExampleAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *MultiAuthExampleAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *MultiAuthExampleAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *MultiAuthExampleAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *MultiAuthExampleAPI) Serve(builder middleware.Builder) http.Handler
- func (o *MultiAuthExampleAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *MultiAuthExampleAPI) SetDefaultConsumes(mediaType string)
- func (o *MultiAuthExampleAPI) SetDefaultProduces(mediaType string)
- func (o *MultiAuthExampleAPI) SetSpec(spec *loads.Document)
- func (o *MultiAuthExampleAPI) Validate() error
Constants ¶
const AddOrderForbiddenCode int = 403
AddOrderForbiddenCode is the HTTP code returned for type AddOrderForbidden
const AddOrderOKCode int = 200
AddOrderOKCode is the HTTP code returned for type AddOrderOK
AddOrderUnauthorizedCode is the HTTP code returned for type AddOrderUnauthorized
const GetAccountOKCode int = 200
GetAccountOKCode is the HTTP code returned for type GetAccountOK
GetAccountUnauthorizedCode is the HTTP code returned for type GetAccountUnauthorized
const GetItemsOKCode int = 200
GetItemsOKCode is the HTTP code returned for type GetItemsOK
const GetOrderForbiddenCode int = 403
GetOrderForbiddenCode is the HTTP code returned for type GetOrderForbidden
const GetOrderOKCode int = 200
GetOrderOKCode is the HTTP code returned for type GetOrderOK
GetOrderUnauthorizedCode is the HTTP code returned for type GetOrderUnauthorized
const GetOrdersForItemForbiddenCode int = 403
GetOrdersForItemForbiddenCode is the HTTP code returned for type GetOrdersForItemForbidden
const GetOrdersForItemOKCode int = 200
GetOrdersForItemOKCode is the HTTP code returned for type GetOrdersForItemOK
GetOrdersForItemUnauthorizedCode is the HTTP code returned for type GetOrdersForItemUnauthorized
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddOrder ¶
type AddOrder struct { Context *middleware.Context Handler AddOrderHandler }
AddOrder swagger:route POST /order/add addOrder
post a new order
Registered customers should be able to add purchase orders. Registered inventory managers should be able to add replenishment orders.
func NewAddOrder ¶
func NewAddOrder(ctx *middleware.Context, handler AddOrderHandler) *AddOrder
NewAddOrder creates a new http.Handler for the add order operation
type AddOrderDefault ¶
type AddOrderDefault struct { /* In: Body */ Payload *models.Error `json:"body,omitempty"` // contains filtered or unexported fields }
AddOrderDefault other error response
swagger:response addOrderDefault
func NewAddOrderDefault ¶
func NewAddOrderDefault(code int) *AddOrderDefault
NewAddOrderDefault creates AddOrderDefault with default headers values
func (*AddOrderDefault) SetPayload ¶
func (o *AddOrderDefault) SetPayload(payload *models.Error)
SetPayload sets the payload to the add order default response
func (*AddOrderDefault) SetStatusCode ¶
func (o *AddOrderDefault) SetStatusCode(code int)
SetStatusCode sets the status to the add order default response
func (*AddOrderDefault) WithPayload ¶
func (o *AddOrderDefault) WithPayload(payload *models.Error) *AddOrderDefault
WithPayload adds the payload to the add order default response
func (*AddOrderDefault) WithStatusCode ¶
func (o *AddOrderDefault) WithStatusCode(code int) *AddOrderDefault
WithStatusCode adds the status to the add order default response
func (*AddOrderDefault) WriteResponse ¶
func (o *AddOrderDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type AddOrderForbidden ¶
type AddOrderForbidden struct { }
AddOrderForbidden forbidden access for a lack of sufficient privileges
swagger:response addOrderForbidden
func NewAddOrderForbidden ¶
func NewAddOrderForbidden() *AddOrderForbidden
NewAddOrderForbidden creates AddOrderForbidden with default headers values
func (*AddOrderForbidden) WriteResponse ¶
func (o *AddOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type AddOrderHandler ¶
type AddOrderHandler interface {
Handle(AddOrderParams, *models.Principal) middleware.Responder
}
AddOrderHandler interface for that can handle valid add order params
type AddOrderHandlerFunc ¶
type AddOrderHandlerFunc func(AddOrderParams, *models.Principal) middleware.Responder
AddOrderHandlerFunc turns a function with the right signature into a add order handler
func (AddOrderHandlerFunc) Handle ¶
func (fn AddOrderHandlerFunc) Handle(params AddOrderParams, principal *models.Principal) middleware.Responder
Handle executing the request and returning a response
type AddOrderOK ¶
type AddOrderOK struct { }
AddOrderOK empty response
swagger:response addOrderOK
func NewAddOrderOK ¶
func NewAddOrderOK() *AddOrderOK
NewAddOrderOK creates AddOrderOK with default headers values
func (*AddOrderOK) WriteResponse ¶
func (o *AddOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type AddOrderParams ¶
type AddOrderParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /* Required: true In: body */ Order *models.Order }
AddOrderParams contains all the bound params for the add order operation typically these are obtained from a http.Request
swagger:parameters AddOrder
func NewAddOrderParams ¶
func NewAddOrderParams() AddOrderParams
NewAddOrderParams creates a new AddOrderParams object no default values defined in spec.
func (*AddOrderParams) BindRequest ¶
func (o *AddOrderParams) 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 NewAddOrderParams() beforehand.
type AddOrderURL ¶
type AddOrderURL struct {
// contains filtered or unexported fields
}
AddOrderURL generates an URL for the add order operation
func (*AddOrderURL) Build ¶
func (o *AddOrderURL) Build() (*url.URL, error)
Build a url path and query string
func (*AddOrderURL) BuildFull ¶
func (o *AddOrderURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*AddOrderURL) SetBasePath ¶
func (o *AddOrderURL) 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 (*AddOrderURL) String ¶
func (o *AddOrderURL) String() string
String returns the string representation of the path with query string
func (*AddOrderURL) StringFull ¶
func (o *AddOrderURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*AddOrderURL) WithBasePath ¶
func (o *AddOrderURL) WithBasePath(bp string) *AddOrderURL
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 AddOrderUnauthorized ¶
type AddOrderUnauthorized struct { }
AddOrderUnauthorized unauthorized access for a lack of authentication
swagger:response addOrderUnauthorized
func NewAddOrderUnauthorized ¶
func NewAddOrderUnauthorized() *AddOrderUnauthorized
NewAddOrderUnauthorized creates AddOrderUnauthorized with default headers values
func (*AddOrderUnauthorized) WriteResponse ¶
func (o *AddOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetAccount ¶
type GetAccount struct { Context *middleware.Context Handler GetAccountHandler }
GetAccount swagger:route GET /account getAccount
registered user account
Every registered user should be able to access this operation
func NewGetAccount ¶
func NewGetAccount(ctx *middleware.Context, handler GetAccountHandler) *GetAccount
NewGetAccount creates a new http.Handler for the get account operation
func (*GetAccount) ServeHTTP ¶
func (o *GetAccount) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type GetAccountDefault ¶
type GetAccountDefault struct { /* In: Body */ Payload *models.Error `json:"body,omitempty"` // contains filtered or unexported fields }
GetAccountDefault other error response
swagger:response getAccountDefault
func NewGetAccountDefault ¶
func NewGetAccountDefault(code int) *GetAccountDefault
NewGetAccountDefault creates GetAccountDefault with default headers values
func (*GetAccountDefault) SetPayload ¶
func (o *GetAccountDefault) SetPayload(payload *models.Error)
SetPayload sets the payload to the get account default response
func (*GetAccountDefault) SetStatusCode ¶
func (o *GetAccountDefault) SetStatusCode(code int)
SetStatusCode sets the status to the get account default response
func (*GetAccountDefault) WithPayload ¶
func (o *GetAccountDefault) WithPayload(payload *models.Error) *GetAccountDefault
WithPayload adds the payload to the get account default response
func (*GetAccountDefault) WithStatusCode ¶
func (o *GetAccountDefault) WithStatusCode(code int) *GetAccountDefault
WithStatusCode adds the status to the get account default response
func (*GetAccountDefault) WriteResponse ¶
func (o *GetAccountDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetAccountHandler ¶
type GetAccountHandler interface {
Handle(GetAccountParams, *models.Principal) middleware.Responder
}
GetAccountHandler interface for that can handle valid get account params
type GetAccountHandlerFunc ¶
type GetAccountHandlerFunc func(GetAccountParams, *models.Principal) middleware.Responder
GetAccountHandlerFunc turns a function with the right signature into a get account handler
func (GetAccountHandlerFunc) Handle ¶
func (fn GetAccountHandlerFunc) Handle(params GetAccountParams, principal *models.Principal) middleware.Responder
Handle executing the request and returning a response
type GetAccountOK ¶
type GetAccountOK struct {
/*
In: Body
*/
Payload interface{} `json:"body,omitempty"`
}
GetAccountOK registered user personal account infos
swagger:response getAccountOK
func NewGetAccountOK ¶
func NewGetAccountOK() *GetAccountOK
NewGetAccountOK creates GetAccountOK with default headers values
func (*GetAccountOK) SetPayload ¶
func (o *GetAccountOK) SetPayload(payload interface{})
SetPayload sets the payload to the get account o k response
func (*GetAccountOK) WithPayload ¶
func (o *GetAccountOK) WithPayload(payload interface{}) *GetAccountOK
WithPayload adds the payload to the get account o k response
func (*GetAccountOK) WriteResponse ¶
func (o *GetAccountOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetAccountParams ¶
GetAccountParams contains all the bound params for the get account operation typically these are obtained from a http.Request
swagger:parameters GetAccount
func NewGetAccountParams ¶
func NewGetAccountParams() GetAccountParams
NewGetAccountParams creates a new GetAccountParams object no default values defined in spec.
func (*GetAccountParams) BindRequest ¶
func (o *GetAccountParams) 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 NewGetAccountParams() beforehand.
type GetAccountURL ¶
type GetAccountURL struct {
// contains filtered or unexported fields
}
GetAccountURL generates an URL for the get account operation
func (*GetAccountURL) Build ¶
func (o *GetAccountURL) Build() (*url.URL, error)
Build a url path and query string
func (*GetAccountURL) BuildFull ¶
func (o *GetAccountURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*GetAccountURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*GetAccountURL) SetBasePath ¶
func (o *GetAccountURL) 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 (*GetAccountURL) String ¶
func (o *GetAccountURL) String() string
String returns the string representation of the path with query string
func (*GetAccountURL) StringFull ¶
func (o *GetAccountURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*GetAccountURL) WithBasePath ¶
func (o *GetAccountURL) WithBasePath(bp string) *GetAccountURL
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 GetAccountUnauthorized ¶
type GetAccountUnauthorized struct { }
GetAccountUnauthorized unauthorized access for a lack of authentication
swagger:response getAccountUnauthorized
func NewGetAccountUnauthorized ¶
func NewGetAccountUnauthorized() *GetAccountUnauthorized
NewGetAccountUnauthorized creates GetAccountUnauthorized with default headers values
func (*GetAccountUnauthorized) WriteResponse ¶
func (o *GetAccountUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetItems ¶
type GetItems struct { Context *middleware.Context Handler GetItemsHandler }
GetItems swagger:route GET /items getItems
items on sale
Everybody should be able to access this operation
func NewGetItems ¶
func NewGetItems(ctx *middleware.Context, handler GetItemsHandler) *GetItems
NewGetItems creates a new http.Handler for the get items operation
type GetItemsDefault ¶
type GetItemsDefault struct { /* In: Body */ Payload *models.Error `json:"body,omitempty"` // contains filtered or unexported fields }
GetItemsDefault other error response
swagger:response getItemsDefault
func NewGetItemsDefault ¶
func NewGetItemsDefault(code int) *GetItemsDefault
NewGetItemsDefault creates GetItemsDefault with default headers values
func (*GetItemsDefault) SetPayload ¶
func (o *GetItemsDefault) SetPayload(payload *models.Error)
SetPayload sets the payload to the get items default response
func (*GetItemsDefault) SetStatusCode ¶
func (o *GetItemsDefault) SetStatusCode(code int)
SetStatusCode sets the status to the get items default response
func (*GetItemsDefault) WithPayload ¶
func (o *GetItemsDefault) WithPayload(payload *models.Error) *GetItemsDefault
WithPayload adds the payload to the get items default response
func (*GetItemsDefault) WithStatusCode ¶
func (o *GetItemsDefault) WithStatusCode(code int) *GetItemsDefault
WithStatusCode adds the status to the get items default response
func (*GetItemsDefault) WriteResponse ¶
func (o *GetItemsDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetItemsHandler ¶
type GetItemsHandler interface {
Handle(GetItemsParams) middleware.Responder
}
GetItemsHandler interface for that can handle valid get items params
type GetItemsHandlerFunc ¶
type GetItemsHandlerFunc func(GetItemsParams) middleware.Responder
GetItemsHandlerFunc turns a function with the right signature into a get items handler
func (GetItemsHandlerFunc) Handle ¶
func (fn GetItemsHandlerFunc) Handle(params GetItemsParams) middleware.Responder
Handle executing the request and returning a response
type GetItemsOK ¶
GetItemsOK multiple items
swagger:response getItemsOK
func NewGetItemsOK ¶
func NewGetItemsOK() *GetItemsOK
NewGetItemsOK creates GetItemsOK with default headers values
func (*GetItemsOK) SetPayload ¶
func (o *GetItemsOK) SetPayload(payload []models.Item)
SetPayload sets the payload to the get items o k response
func (*GetItemsOK) WithPayload ¶
func (o *GetItemsOK) WithPayload(payload []models.Item) *GetItemsOK
WithPayload adds the payload to the get items o k response
func (*GetItemsOK) WriteResponse ¶
func (o *GetItemsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetItemsParams ¶
GetItemsParams contains all the bound params for the get items operation typically these are obtained from a http.Request
swagger:parameters GetItems
func NewGetItemsParams ¶
func NewGetItemsParams() GetItemsParams
NewGetItemsParams creates a new GetItemsParams object no default values defined in spec.
func (*GetItemsParams) BindRequest ¶
func (o *GetItemsParams) 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 NewGetItemsParams() beforehand.
type GetItemsURL ¶
type GetItemsURL struct {
// contains filtered or unexported fields
}
GetItemsURL generates an URL for the get items operation
func (*GetItemsURL) Build ¶
func (o *GetItemsURL) Build() (*url.URL, error)
Build a url path and query string
func (*GetItemsURL) BuildFull ¶
func (o *GetItemsURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*GetItemsURL) SetBasePath ¶
func (o *GetItemsURL) 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 (*GetItemsURL) String ¶
func (o *GetItemsURL) String() string
String returns the string representation of the path with query string
func (*GetItemsURL) StringFull ¶
func (o *GetItemsURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*GetItemsURL) WithBasePath ¶
func (o *GetItemsURL) WithBasePath(bp string) *GetItemsURL
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 GetOrder ¶
type GetOrder struct { Context *middleware.Context Handler GetOrderHandler }
GetOrder swagger:route GET /order/{orderID} getOrder
retrieves an order
Only registered customers should be able to retrieve orders
func NewGetOrder ¶
func NewGetOrder(ctx *middleware.Context, handler GetOrderHandler) *GetOrder
NewGetOrder creates a new http.Handler for the get order operation
type GetOrderDefault ¶
type GetOrderDefault struct { /* In: Body */ Payload *models.Error `json:"body,omitempty"` // contains filtered or unexported fields }
GetOrderDefault other error response
swagger:response getOrderDefault
func NewGetOrderDefault ¶
func NewGetOrderDefault(code int) *GetOrderDefault
NewGetOrderDefault creates GetOrderDefault with default headers values
func (*GetOrderDefault) SetPayload ¶
func (o *GetOrderDefault) SetPayload(payload *models.Error)
SetPayload sets the payload to the get order default response
func (*GetOrderDefault) SetStatusCode ¶
func (o *GetOrderDefault) SetStatusCode(code int)
SetStatusCode sets the status to the get order default response
func (*GetOrderDefault) WithPayload ¶
func (o *GetOrderDefault) WithPayload(payload *models.Error) *GetOrderDefault
WithPayload adds the payload to the get order default response
func (*GetOrderDefault) WithStatusCode ¶
func (o *GetOrderDefault) WithStatusCode(code int) *GetOrderDefault
WithStatusCode adds the status to the get order default response
func (*GetOrderDefault) WriteResponse ¶
func (o *GetOrderDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetOrderForbidden ¶
type GetOrderForbidden struct { }
GetOrderForbidden forbidden access for a lack of sufficient privileges
swagger:response getOrderForbidden
func NewGetOrderForbidden ¶
func NewGetOrderForbidden() *GetOrderForbidden
NewGetOrderForbidden creates GetOrderForbidden with default headers values
func (*GetOrderForbidden) WriteResponse ¶
func (o *GetOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetOrderHandler ¶
type GetOrderHandler interface {
Handle(GetOrderParams, *models.Principal) middleware.Responder
}
GetOrderHandler interface for that can handle valid get order params
type GetOrderHandlerFunc ¶
type GetOrderHandlerFunc func(GetOrderParams, *models.Principal) middleware.Responder
GetOrderHandlerFunc turns a function with the right signature into a get order handler
func (GetOrderHandlerFunc) Handle ¶
func (fn GetOrderHandlerFunc) Handle(params GetOrderParams, principal *models.Principal) middleware.Responder
Handle executing the request and returning a response
type GetOrderOK ¶
GetOrderOK content of an order
swagger:response getOrderOK
func NewGetOrderOK ¶
func NewGetOrderOK() *GetOrderOK
NewGetOrderOK creates GetOrderOK with default headers values
func (*GetOrderOK) SetPayload ¶
func (o *GetOrderOK) SetPayload(payload *models.Order)
SetPayload sets the payload to the get order o k response
func (*GetOrderOK) WithPayload ¶
func (o *GetOrderOK) WithPayload(payload *models.Order) *GetOrderOK
WithPayload adds the payload to the get order o k response
func (*GetOrderOK) WriteResponse ¶
func (o *GetOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetOrderParams ¶
type GetOrderParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /* Required: true In: path */ OrderID string }
GetOrderParams contains all the bound params for the get order operation typically these are obtained from a http.Request
swagger:parameters GetOrder
func NewGetOrderParams ¶
func NewGetOrderParams() GetOrderParams
NewGetOrderParams creates a new GetOrderParams object no default values defined in spec.
func (*GetOrderParams) BindRequest ¶
func (o *GetOrderParams) 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 NewGetOrderParams() beforehand.
type GetOrderURL ¶
type GetOrderURL struct { OrderID string // contains filtered or unexported fields }
GetOrderURL generates an URL for the get order operation
func (*GetOrderURL) Build ¶
func (o *GetOrderURL) Build() (*url.URL, error)
Build a url path and query string
func (*GetOrderURL) BuildFull ¶
func (o *GetOrderURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*GetOrderURL) SetBasePath ¶
func (o *GetOrderURL) 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 (*GetOrderURL) String ¶
func (o *GetOrderURL) String() string
String returns the string representation of the path with query string
func (*GetOrderURL) StringFull ¶
func (o *GetOrderURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*GetOrderURL) WithBasePath ¶
func (o *GetOrderURL) WithBasePath(bp string) *GetOrderURL
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 GetOrderUnauthorized ¶
type GetOrderUnauthorized struct { }
GetOrderUnauthorized unauthorized access for a lack of authentication
swagger:response getOrderUnauthorized
func NewGetOrderUnauthorized ¶
func NewGetOrderUnauthorized() *GetOrderUnauthorized
NewGetOrderUnauthorized creates GetOrderUnauthorized with default headers values
func (*GetOrderUnauthorized) WriteResponse ¶
func (o *GetOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetOrdersForItem ¶
type GetOrdersForItem struct { Context *middleware.Context Handler GetOrdersForItemHandler }
GetOrdersForItem swagger:route GET /orders/{itemID} getOrdersForItem
retrieves all orders for an item
Only registered resellers should be able to search orders for an item
func NewGetOrdersForItem ¶
func NewGetOrdersForItem(ctx *middleware.Context, handler GetOrdersForItemHandler) *GetOrdersForItem
NewGetOrdersForItem creates a new http.Handler for the get orders for item operation
func (*GetOrdersForItem) ServeHTTP ¶
func (o *GetOrdersForItem) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type GetOrdersForItemDefault ¶
type GetOrdersForItemDefault struct { /* In: Body */ Payload *models.Error `json:"body,omitempty"` // contains filtered or unexported fields }
GetOrdersForItemDefault other error response
swagger:response getOrdersForItemDefault
func NewGetOrdersForItemDefault ¶
func NewGetOrdersForItemDefault(code int) *GetOrdersForItemDefault
NewGetOrdersForItemDefault creates GetOrdersForItemDefault with default headers values
func (*GetOrdersForItemDefault) SetPayload ¶
func (o *GetOrdersForItemDefault) SetPayload(payload *models.Error)
SetPayload sets the payload to the get orders for item default response
func (*GetOrdersForItemDefault) SetStatusCode ¶
func (o *GetOrdersForItemDefault) SetStatusCode(code int)
SetStatusCode sets the status to the get orders for item default response
func (*GetOrdersForItemDefault) WithPayload ¶
func (o *GetOrdersForItemDefault) WithPayload(payload *models.Error) *GetOrdersForItemDefault
WithPayload adds the payload to the get orders for item default response
func (*GetOrdersForItemDefault) WithStatusCode ¶
func (o *GetOrdersForItemDefault) WithStatusCode(code int) *GetOrdersForItemDefault
WithStatusCode adds the status to the get orders for item default response
func (*GetOrdersForItemDefault) WriteResponse ¶
func (o *GetOrdersForItemDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetOrdersForItemForbidden ¶
type GetOrdersForItemForbidden struct { }
GetOrdersForItemForbidden forbidden access for a lack of sufficient privileges
swagger:response getOrdersForItemForbidden
func NewGetOrdersForItemForbidden ¶
func NewGetOrdersForItemForbidden() *GetOrdersForItemForbidden
NewGetOrdersForItemForbidden creates GetOrdersForItemForbidden with default headers values
func (*GetOrdersForItemForbidden) WriteResponse ¶
func (o *GetOrdersForItemForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetOrdersForItemHandler ¶
type GetOrdersForItemHandler interface {
Handle(GetOrdersForItemParams, *models.Principal) middleware.Responder
}
GetOrdersForItemHandler interface for that can handle valid get orders for item params
type GetOrdersForItemHandlerFunc ¶
type GetOrdersForItemHandlerFunc func(GetOrdersForItemParams, *models.Principal) middleware.Responder
GetOrdersForItemHandlerFunc turns a function with the right signature into a get orders for item handler
func (GetOrdersForItemHandlerFunc) Handle ¶
func (fn GetOrdersForItemHandlerFunc) Handle(params GetOrdersForItemParams, principal *models.Principal) middleware.Responder
Handle executing the request and returning a response
type GetOrdersForItemOK ¶
GetOrdersForItemOK multiple orders
swagger:response getOrdersForItemOK
func NewGetOrdersForItemOK ¶
func NewGetOrdersForItemOK() *GetOrdersForItemOK
NewGetOrdersForItemOK creates GetOrdersForItemOK with default headers values
func (*GetOrdersForItemOK) SetPayload ¶
func (o *GetOrdersForItemOK) SetPayload(payload []*models.Order)
SetPayload sets the payload to the get orders for item o k response
func (*GetOrdersForItemOK) WithPayload ¶
func (o *GetOrdersForItemOK) WithPayload(payload []*models.Order) *GetOrdersForItemOK
WithPayload adds the payload to the get orders for item o k response
func (*GetOrdersForItemOK) WriteResponse ¶
func (o *GetOrdersForItemOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetOrdersForItemParams ¶
type GetOrdersForItemParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /* Required: true In: path */ ItemID string }
GetOrdersForItemParams contains all the bound params for the get orders for item operation typically these are obtained from a http.Request
swagger:parameters GetOrdersForItem
func NewGetOrdersForItemParams ¶
func NewGetOrdersForItemParams() GetOrdersForItemParams
NewGetOrdersForItemParams creates a new GetOrdersForItemParams object no default values defined in spec.
func (*GetOrdersForItemParams) BindRequest ¶
func (o *GetOrdersForItemParams) 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 NewGetOrdersForItemParams() beforehand.
type GetOrdersForItemURL ¶
type GetOrdersForItemURL struct { ItemID string // contains filtered or unexported fields }
GetOrdersForItemURL generates an URL for the get orders for item operation
func (*GetOrdersForItemURL) Build ¶
func (o *GetOrdersForItemURL) Build() (*url.URL, error)
Build a url path and query string
func (*GetOrdersForItemURL) BuildFull ¶
func (o *GetOrdersForItemURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*GetOrdersForItemURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*GetOrdersForItemURL) SetBasePath ¶
func (o *GetOrdersForItemURL) 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 (*GetOrdersForItemURL) String ¶
func (o *GetOrdersForItemURL) String() string
String returns the string representation of the path with query string
func (*GetOrdersForItemURL) StringFull ¶
func (o *GetOrdersForItemURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*GetOrdersForItemURL) WithBasePath ¶
func (o *GetOrdersForItemURL) WithBasePath(bp string) *GetOrdersForItemURL
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 GetOrdersForItemUnauthorized ¶
type GetOrdersForItemUnauthorized struct { }
GetOrdersForItemUnauthorized unauthorized access for a lack of authentication
swagger:response getOrdersForItemUnauthorized
func NewGetOrdersForItemUnauthorized ¶
func NewGetOrdersForItemUnauthorized() *GetOrdersForItemUnauthorized
NewGetOrdersForItemUnauthorized creates GetOrdersForItemUnauthorized with default headers values
func (*GetOrdersForItemUnauthorized) WriteResponse ¶
func (o *GetOrdersForItemUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type MultiAuthExampleAPI ¶
type MultiAuthExampleAPI struct { Middleware func(middleware.Builder) http.Handler // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. // It has a default implemention in the security package, however you can replace it for your particular usage. BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. // It has a default implemention in the security package, however you can replace it for your particular usage. APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. // It has a default implemention in the security package, however you can replace it for your particular usage. BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator // JSONConsumer registers a consumer for a "application/json" mime type JSONConsumer runtime.Consumer // JSONProducer registers a producer for a "application/json" mime type JSONProducer runtime.Producer // HasRoleAuth registers a function that takes an access token and a collection of required scopes and returns a principal // it performs authentication based on an oauth2 bearer token provided in the request HasRoleAuth func(string, []string) (*models.Principal, error) // IsRegisteredAuth registers a function that takes username and password and returns a principal // it performs authentication with basic auth IsRegisteredAuth func(string, string) (*models.Principal, error) // IsResellerAuth registers a function that takes a token and returns a principal // it performs authentication based on an api key X-Custom-Key provided in the header IsResellerAuth func(string) (*models.Principal, error) // IsResellerQueryAuth registers a function that takes a token and returns a principal // it performs authentication based on an api key CustomKeyAsQuery provided in the query IsResellerQueryAuth func(string) (*models.Principal, error) // APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal APIAuthorizer runtime.Authorizer // AddOrderHandler sets the operation handler for the add order operation AddOrderHandler AddOrderHandler // GetAccountHandler sets the operation handler for the get account operation GetAccountHandler GetAccountHandler // GetItemsHandler sets the operation handler for the get items operation GetItemsHandler GetItemsHandler // GetOrderHandler sets the operation handler for the get order operation GetOrderHandler GetOrderHandler // GetOrdersForItemHandler sets the operation handler for the get orders for item operation GetOrdersForItemHandler GetOrdersForItemHandler // ServeError is called when an error is received, there is a default handler // but you can set your own with this ServeError func(http.ResponseWriter, *http.Request, error) // ServerShutdown is called when the HTTP(S) server is shut down and done // handling all active connections and does not accept connections any more ServerShutdown func() // Custom command line argument groups with their descriptions CommandLineOptionsGroups []swag.CommandLineOptionsGroup // User defined logger function. Logger func(string, ...interface{}) // contains filtered or unexported fields }
MultiAuthExampleAPI This sample API demonstrates how to compose several authentication schemes and configure complex security requirements for your operations.
This API simulates a very simple market place with customers and resellers of items.
Personas:
- as a first time user, I want to see all items on sales
- as a registered customer, I want to post orders for items and consult my past orders
- as a registered reseller, I want to see all pending orders on the items I am selling on the market place
- as a reseller managing my own inventories, I want to post replenishment orders for the items I provide
- as a register user, I want to consult my personal account infos
The situation we defined on the authentication side is as follows:
- every known user is authenticated using a basic token
- resellers are authenticated using API keys - we let the option to authenticate using a header or query param
- any registered user (customer or reseller) will add a signed JWT to access more API endpoints
Obviously, there are several ways to achieve the same result. We just wanted to demonstrate here how security requirements may compose several schemes.
Note that we used the "OAuth2" declaration here but don't implement a real OAuth2 workflow: our intend here is just to be able to extract scopes from a passed JWT token (the only way to manipulate scoped authorizers with Swagger 2.0 is to declare them with type "oauth2").
func NewMultiAuthExampleAPI ¶
func NewMultiAuthExampleAPI(spec *loads.Document) *MultiAuthExampleAPI
NewMultiAuthExampleAPI creates a new MultiAuthExample instance
func (*MultiAuthExampleAPI) AuthenticatorsFor ¶
func (o *MultiAuthExampleAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*MultiAuthExampleAPI) Authorizer ¶
func (o *MultiAuthExampleAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*MultiAuthExampleAPI) ConsumersFor ¶
func (o *MultiAuthExampleAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
ConsumersFor gets the consumers for the specified media types
func (*MultiAuthExampleAPI) Context ¶
func (o *MultiAuthExampleAPI) Context() *middleware.Context
Context returns the middleware context for the multi auth example API
func (*MultiAuthExampleAPI) DefaultConsumes ¶
func (o *MultiAuthExampleAPI) DefaultConsumes() string
DefaultConsumes returns the default consumes media type
func (*MultiAuthExampleAPI) DefaultProduces ¶
func (o *MultiAuthExampleAPI) DefaultProduces() string
DefaultProduces returns the default produces media type
func (*MultiAuthExampleAPI) Formats ¶
func (o *MultiAuthExampleAPI) Formats() strfmt.Registry
Formats returns the registered string formats
func (*MultiAuthExampleAPI) HandlerFor ¶
func (o *MultiAuthExampleAPI) HandlerFor(method, path string) (http.Handler, bool)
HandlerFor gets a http.Handler for the provided operation method and path
func (*MultiAuthExampleAPI) Init ¶
func (o *MultiAuthExampleAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*MultiAuthExampleAPI) ProducersFor ¶
func (o *MultiAuthExampleAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
ProducersFor gets the producers for the specified media types
func (*MultiAuthExampleAPI) RegisterConsumer ¶
func (o *MultiAuthExampleAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*MultiAuthExampleAPI) RegisterFormat ¶
func (o *MultiAuthExampleAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
RegisterFormat registers a custom format validator
func (*MultiAuthExampleAPI) RegisterProducer ¶
func (o *MultiAuthExampleAPI) RegisterProducer(mediaType string, producer runtime.Producer)
RegisterProducer allows you to add (or override) a producer for a media type.
func (*MultiAuthExampleAPI) Serve ¶
func (o *MultiAuthExampleAPI) Serve(builder middleware.Builder) http.Handler
Serve creates a http handler to serve the API over HTTP can be used directly in http.ListenAndServe(":8000", api.Serve(nil))
func (*MultiAuthExampleAPI) ServeErrorFor ¶
func (o *MultiAuthExampleAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*MultiAuthExampleAPI) SetDefaultConsumes ¶
func (o *MultiAuthExampleAPI) SetDefaultConsumes(mediaType string)
SetDefaultConsumes returns the default consumes media type
func (*MultiAuthExampleAPI) SetDefaultProduces ¶
func (o *MultiAuthExampleAPI) SetDefaultProduces(mediaType string)
SetDefaultProduces sets the default produces media type
func (*MultiAuthExampleAPI) SetSpec ¶
func (o *MultiAuthExampleAPI) SetSpec(spec *loads.Document)
SetSpec sets a spec that will be served for the clients.
func (*MultiAuthExampleAPI) Validate ¶
func (o *MultiAuthExampleAPI) Validate() error
Validate validates the registrations in the MultiAuthExampleAPI
Source Files ¶
- add_order.go
- add_order_parameters.go
- add_order_responses.go
- add_order_urlbuilder.go
- get_account.go
- get_account_parameters.go
- get_account_responses.go
- get_account_urlbuilder.go
- get_items.go
- get_items_parameters.go
- get_items_responses.go
- get_items_urlbuilder.go
- get_order.go
- get_order_parameters.go
- get_order_responses.go
- get_order_urlbuilder.go
- get_orders_for_item.go
- get_orders_for_item_parameters.go
- get_orders_for_item_responses.go
- get_orders_for_item_urlbuilder.go
- multi_auth_example_api.go