operations

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2018 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const GetCustomCountOKCode int = 200

GetCustomCountOKCode is the HTTP code returned for type GetCustomCountOK

View Source
const GetHealthOKCode int = 200

GetHealthOKCode is the HTTP code returned for type GetHealthOK

View Source
const GetUsersCountOKCode int = 200

GetUsersCountOKCode is the HTTP code returned for type GetUsersCountOK

Variables

This section is empty.

Functions

This section is empty.

Types

type GetCustomCount

type GetCustomCount struct {
	Context *middleware.Context
	Handler GetCustomCountHandler
}

GetCustomCount swagger:route GET /custom/{count} getCustomCount

Generate results based on a pattern/template.

func NewGetCustomCount

func NewGetCustomCount(ctx *middleware.Context, handler GetCustomCountHandler) *GetCustomCount

NewGetCustomCount creates a new http.Handler for the get custom count operation

func (*GetCustomCount) ServeHTTP

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

type GetCustomCountDefault

type GetCustomCountDefault struct {

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

GetCustomCountDefault Error occurred

swagger:response getCustomCountDefault

func NewGetCustomCountDefault

func NewGetCustomCountDefault(code int) *GetCustomCountDefault

NewGetCustomCountDefault creates GetCustomCountDefault with default headers values

func (*GetCustomCountDefault) SetPayload

func (o *GetCustomCountDefault) SetPayload(payload *models.ErrorModel)

SetPayload sets the payload to the get custom count default response

func (*GetCustomCountDefault) SetStatusCode

func (o *GetCustomCountDefault) SetStatusCode(code int)

SetStatusCode sets the status to the get custom count default response

func (*GetCustomCountDefault) WithPayload

WithPayload adds the payload to the get custom count default response

func (*GetCustomCountDefault) WithStatusCode

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

WithStatusCode adds the status to the get custom count default response

func (*GetCustomCountDefault) WriteResponse

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

WriteResponse to the client

type GetCustomCountHandler

type GetCustomCountHandler interface {
	Handle(GetCustomCountParams, interface{}) middleware.Responder
}

GetCustomCountHandler interface for that can handle valid get custom count params

type GetCustomCountHandlerFunc

type GetCustomCountHandlerFunc func(GetCustomCountParams, interface{}) middleware.Responder

GetCustomCountHandlerFunc turns a function with the right signature into a get custom count handler

func (GetCustomCountHandlerFunc) Handle

func (fn GetCustomCountHandlerFunc) Handle(params GetCustomCountParams, principal interface{}) middleware.Responder

Handle executing the request and returning a response

type GetCustomCountOK

type GetCustomCountOK struct {

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

GetCustomCountOK The results were successfully generated

swagger:response getCustomCountOK

func NewGetCustomCountOK

func NewGetCustomCountOK() *GetCustomCountOK

NewGetCustomCountOK creates GetCustomCountOK with default headers values

func (*GetCustomCountOK) SetPayload

func (o *GetCustomCountOK) SetPayload(payload *models.CustomResponseModel)

SetPayload sets the payload to the get custom count o k response

func (*GetCustomCountOK) WithPayload

func (o *GetCustomCountOK) WithPayload(payload *models.CustomResponseModel) *GetCustomCountOK

WithPayload adds the payload to the get custom count o k response

func (*GetCustomCountOK) WriteResponse

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

WriteResponse to the client

type GetCustomCountParams

type GetCustomCountParams struct {

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

	/*How many results to generate.
	  Required: true
	  Maximum: 500
	  Minimum: 1
	  In: path
	*/
	Count int32
	/*The seed for the pseudo-random generator. For each unique value the same results will be given. If no seed is provided a pseudo-random one will be generated (rand.Int63).
	  In: query
	*/
	Seed *int64
	/*The template used to generate the results, eg: 'My name is ~name~'
	  Required: true
	  Max Length: 1024
	  Min Length: 1
	  In: query
	*/
	Template string
}

GetCustomCountParams contains all the bound params for the get custom count operation typically these are obtained from a http.Request

swagger:parameters GetCustomCount

func NewGetCustomCountParams

func NewGetCustomCountParams() GetCustomCountParams

NewGetCustomCountParams creates a new GetCustomCountParams object no default values defined in spec.

func (*GetCustomCountParams) BindRequest

func (o *GetCustomCountParams) 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 NewGetCustomCountParams() beforehand.

type GetCustomCountURL

type GetCustomCountURL struct {
	Count int32

	Seed     *int64
	Template string
	// contains filtered or unexported fields
}

GetCustomCountURL generates an URL for the get custom count operation

func (*GetCustomCountURL) Build

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

Build a url path and query string

func (*GetCustomCountURL) BuildFull

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

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

func (*GetCustomCountURL) Must

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

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

func (*GetCustomCountURL) SetBasePath

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

func (o *GetCustomCountURL) String() string

String returns the string representation of the path with query string

func (*GetCustomCountURL) StringFull

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

StringFull returns the string representation of a complete url

func (*GetCustomCountURL) WithBasePath

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

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 GetHealth

type GetHealth struct {
	Context *middleware.Context
	Handler GetHealthHandler
}

GetHealth swagger:route GET /health getHealth

Get the health of the service

func NewGetHealth

func NewGetHealth(ctx *middleware.Context, handler GetHealthHandler) *GetHealth

NewGetHealth creates a new http.Handler for the get health operation

func (*GetHealth) ServeHTTP

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

type GetHealthDefault

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

GetHealthDefault Service is not available

swagger:response getHealthDefault

func NewGetHealthDefault

func NewGetHealthDefault(code int) *GetHealthDefault

NewGetHealthDefault creates GetHealthDefault with default headers values

func (*GetHealthDefault) SetStatusCode

func (o *GetHealthDefault) SetStatusCode(code int)

SetStatusCode sets the status to the get health default response

func (*GetHealthDefault) WithStatusCode

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

WithStatusCode adds the status to the get health default response

func (*GetHealthDefault) WriteResponse

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

WriteResponse to the client

type GetHealthHandler

type GetHealthHandler interface {
	Handle(GetHealthParams, interface{}) middleware.Responder
}

GetHealthHandler interface for that can handle valid get health params

type GetHealthHandlerFunc

type GetHealthHandlerFunc func(GetHealthParams, interface{}) middleware.Responder

GetHealthHandlerFunc turns a function with the right signature into a get health handler

func (GetHealthHandlerFunc) Handle

func (fn GetHealthHandlerFunc) Handle(params GetHealthParams, principal interface{}) middleware.Responder

Handle executing the request and returning a response

type GetHealthOK

type GetHealthOK struct {
}

GetHealthOK Everything is fine

swagger:response getHealthOK

func NewGetHealthOK

func NewGetHealthOK() *GetHealthOK

NewGetHealthOK creates GetHealthOK with default headers values

func (*GetHealthOK) WriteResponse

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

WriteResponse to the client

type GetHealthParams

type GetHealthParams struct {

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

GetHealthParams contains all the bound params for the get health operation typically these are obtained from a http.Request

swagger:parameters GetHealth

func NewGetHealthParams

func NewGetHealthParams() GetHealthParams

NewGetHealthParams creates a new GetHealthParams object no default values defined in spec.

func (*GetHealthParams) BindRequest

func (o *GetHealthParams) 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 NewGetHealthParams() beforehand.

type GetHealthURL

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

GetHealthURL generates an URL for the get health operation

func (*GetHealthURL) Build

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

Build a url path and query string

func (*GetHealthURL) BuildFull

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

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

func (*GetHealthURL) Must

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

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

func (*GetHealthURL) SetBasePath

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

func (o *GetHealthURL) String() string

String returns the string representation of the path with query string

func (*GetHealthURL) StringFull

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

StringFull returns the string representation of a complete url

func (*GetHealthURL) WithBasePath

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

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 GetUsersCount

type GetUsersCount struct {
	Context *middleware.Context
	Handler GetUsersCountHandler
}

GetUsersCount swagger:route GET /users/{count} getUsersCount

Get a random user

func NewGetUsersCount

func NewGetUsersCount(ctx *middleware.Context, handler GetUsersCountHandler) *GetUsersCount

NewGetUsersCount creates a new http.Handler for the get users count operation

func (*GetUsersCount) ServeHTTP

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

type GetUsersCountDefault

type GetUsersCountDefault struct {

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

GetUsersCountDefault Error occurred

swagger:response getUsersCountDefault

func NewGetUsersCountDefault

func NewGetUsersCountDefault(code int) *GetUsersCountDefault

NewGetUsersCountDefault creates GetUsersCountDefault with default headers values

func (*GetUsersCountDefault) SetPayload

func (o *GetUsersCountDefault) SetPayload(payload *models.ErrorModel)

SetPayload sets the payload to the get users count default response

func (*GetUsersCountDefault) SetStatusCode

func (o *GetUsersCountDefault) SetStatusCode(code int)

SetStatusCode sets the status to the get users count default response

func (*GetUsersCountDefault) WithPayload

func (o *GetUsersCountDefault) WithPayload(payload *models.ErrorModel) *GetUsersCountDefault

WithPayload adds the payload to the get users count default response

func (*GetUsersCountDefault) WithStatusCode

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

WithStatusCode adds the status to the get users count default response

func (*GetUsersCountDefault) WriteResponse

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

WriteResponse to the client

type GetUsersCountHandler

type GetUsersCountHandler interface {
	Handle(GetUsersCountParams, interface{}) middleware.Responder
}

GetUsersCountHandler interface for that can handle valid get users count params

type GetUsersCountHandlerFunc

type GetUsersCountHandlerFunc func(GetUsersCountParams, interface{}) middleware.Responder

GetUsersCountHandlerFunc turns a function with the right signature into a get users count handler

func (GetUsersCountHandlerFunc) Handle

func (fn GetUsersCountHandlerFunc) Handle(params GetUsersCountParams, principal interface{}) middleware.Responder

Handle executing the request and returning a response

type GetUsersCountOK

type GetUsersCountOK struct {

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

GetUsersCountOK The users were successfully generated

swagger:response getUsersCountOK

func NewGetUsersCountOK

func NewGetUsersCountOK() *GetUsersCountOK

NewGetUsersCountOK creates GetUsersCountOK with default headers values

func (*GetUsersCountOK) SetPayload

func (o *GetUsersCountOK) SetPayload(payload *models.UserResponseModel)

SetPayload sets the payload to the get users count o k response

func (*GetUsersCountOK) WithPayload

func (o *GetUsersCountOK) WithPayload(payload *models.UserResponseModel) *GetUsersCountOK

WithPayload adds the payload to the get users count o k response

func (*GetUsersCountOK) WriteResponse

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

WriteResponse to the client

type GetUsersCountParams

type GetUsersCountParams struct {

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

	/*How many results to generate.
	  Required: true
	  Maximum: 500
	  Minimum: 1
	  In: path
	*/
	Count int32
	/*The seed for the pseudo-random generator. For each unique value the same results will be given. If no seed is provided a pseudo-random one will be generated (rand.Int63).
	  In: query
	*/
	Seed *int64
}

GetUsersCountParams contains all the bound params for the get users count operation typically these are obtained from a http.Request

swagger:parameters GetUsersCount

func NewGetUsersCountParams

func NewGetUsersCountParams() GetUsersCountParams

NewGetUsersCountParams creates a new GetUsersCountParams object no default values defined in spec.

func (*GetUsersCountParams) BindRequest

func (o *GetUsersCountParams) 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 NewGetUsersCountParams() beforehand.

type GetUsersCountURL

type GetUsersCountURL struct {
	Count int32

	Seed *int64
	// contains filtered or unexported fields
}

GetUsersCountURL generates an URL for the get users count operation

func (*GetUsersCountURL) Build

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

Build a url path and query string

func (*GetUsersCountURL) BuildFull

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

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

func (*GetUsersCountURL) Must

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

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

func (*GetUsersCountURL) SetBasePath

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

func (o *GetUsersCountURL) String() string

String returns the string representation of the path with query string

func (*GetUsersCountURL) StringFull

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

StringFull returns the string representation of a complete url

func (*GetUsersCountURL) WithBasePath

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

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 PseudoServiceAPI

type PseudoServiceAPI 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

	// ApikeyAuth registers a function that takes a token and returns a principal
	// it performs authentication based on an api key token provided in the query
	ApikeyAuth func(string) (interface{}, error)

	// APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal
	APIAuthorizer runtime.Authorizer

	// GetCustomCountHandler sets the operation handler for the get custom count operation
	GetCustomCountHandler GetCustomCountHandler
	// GetHealthHandler sets the operation handler for the get health operation
	GetHealthHandler GetHealthHandler
	// GetUsersCountHandler sets the operation handler for the get users count operation
	GetUsersCountHandler GetUsersCountHandler

	// 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
}

PseudoServiceAPI Deterministic or pseudo-random data generator

func NewPseudoServiceAPI

func NewPseudoServiceAPI(spec *loads.Document) *PseudoServiceAPI

NewPseudoServiceAPI creates a new PseudoService instance

func (*PseudoServiceAPI) AuthenticatorsFor

func (o *PseudoServiceAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*PseudoServiceAPI) Authorizer

func (o *PseudoServiceAPI) Authorizer() runtime.Authorizer

Authorizer returns the registered authorizer

func (*PseudoServiceAPI) ConsumersFor

func (o *PseudoServiceAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer

ConsumersFor gets the consumers for the specified media types

func (*PseudoServiceAPI) Context

func (o *PseudoServiceAPI) Context() *middleware.Context

Context returns the middleware context for the pseudo service API

func (*PseudoServiceAPI) DefaultConsumes

func (o *PseudoServiceAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*PseudoServiceAPI) DefaultProduces

func (o *PseudoServiceAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*PseudoServiceAPI) Formats

func (o *PseudoServiceAPI) Formats() strfmt.Registry

Formats returns the registered string formats

func (*PseudoServiceAPI) HandlerFor

func (o *PseudoServiceAPI) HandlerFor(method, path string) (http.Handler, bool)

HandlerFor gets a http.Handler for the provided operation method and path

func (*PseudoServiceAPI) Init

func (o *PseudoServiceAPI) Init()

Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit

func (*PseudoServiceAPI) ProducersFor

func (o *PseudoServiceAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer

ProducersFor gets the producers for the specified media types

func (*PseudoServiceAPI) RegisterConsumer

func (o *PseudoServiceAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)

RegisterConsumer allows you to add (or override) a consumer for a media type.

func (*PseudoServiceAPI) RegisterFormat

func (o *PseudoServiceAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)

RegisterFormat registers a custom format validator

func (*PseudoServiceAPI) RegisterProducer

func (o *PseudoServiceAPI) RegisterProducer(mediaType string, producer runtime.Producer)

RegisterProducer allows you to add (or override) a producer for a media type.

func (*PseudoServiceAPI) Serve

func (o *PseudoServiceAPI) 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 (*PseudoServiceAPI) ServeErrorFor

func (o *PseudoServiceAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)

ServeErrorFor gets a error handler for a given operation id

func (*PseudoServiceAPI) SetDefaultConsumes

func (o *PseudoServiceAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*PseudoServiceAPI) SetDefaultProduces

func (o *PseudoServiceAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*PseudoServiceAPI) SetSpec

func (o *PseudoServiceAPI) SetSpec(spec *loads.Document)

SetSpec sets a spec that will be served for the clients.

func (*PseudoServiceAPI) Validate

func (o *PseudoServiceAPI) Validate() error

Validate validates the registrations in the PseudoServiceAPI

Jump to

Keyboard shortcuts

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