operations

package
v0.0.0-...-fa71129 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const TimeGetInternalServerErrorCode int = 500

TimeGetInternalServerErrorCode is the HTTP code returned for type TimeGetInternalServerError

View Source
const TimeGetNotFoundCode int = 404

TimeGetNotFoundCode is the HTTP code returned for type TimeGetNotFound

View Source
const TimeGetOKCode int = 200

TimeGetOKCode is the HTTP code returned for type TimeGetOK

View Source
const TimePostInternalServerErrorCode int = 500

TimePostInternalServerErrorCode is the HTTP code returned for type TimePostInternalServerError

View Source
const TimePostNotFoundCode int = 404

TimePostNotFoundCode is the HTTP code returned for type TimePostNotFound

View Source
const TimePostOKCode int = 200

TimePostOKCode is the HTTP code returned for type TimePostOK

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeGet

type TimeGet struct {
	Context *middleware.Context
	Handler TimeGetHandler
}

TimeGet swagger:route GET /time timeGet

Returns time of day.

func NewTimeGet

func NewTimeGet(ctx *middleware.Context, handler TimeGetHandler) *TimeGet

NewTimeGet creates a new http.Handler for the time get operation

func (*TimeGet) ServeHTTP

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

type TimeGetHandler

type TimeGetHandler interface {
	Handle(TimeGetParams) middleware.Responder
}

TimeGetHandler interface for that can handle valid time get params

type TimeGetHandlerFunc

type TimeGetHandlerFunc func(TimeGetParams) middleware.Responder

TimeGetHandlerFunc turns a function with the right signature into a time get handler

func (TimeGetHandlerFunc) Handle

Handle executing the request and returning a response

type TimeGetInternalServerError

type TimeGetInternalServerError struct {

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

TimeGetInternalServerError Something has gone horribly wrong

swagger:response timeGetInternalServerError

func NewTimeGetInternalServerError

func NewTimeGetInternalServerError() *TimeGetInternalServerError

NewTimeGetInternalServerError creates TimeGetInternalServerError with default headers values

func (*TimeGetInternalServerError) SetPayload

func (o *TimeGetInternalServerError) SetPayload(payload *models.ErrorResponse)

SetPayload sets the payload to the time get internal server error response

func (*TimeGetInternalServerError) WithPayload

WithPayload adds the payload to the time get internal server error response

func (*TimeGetInternalServerError) WriteResponse

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

WriteResponse to the client

type TimeGetNotFound

type TimeGetNotFound struct {

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

TimeGetNotFound Time zone not found

swagger:response timeGetNotFound

func NewTimeGetNotFound

func NewTimeGetNotFound() *TimeGetNotFound

NewTimeGetNotFound creates TimeGetNotFound with default headers values

func (*TimeGetNotFound) SetPayload

func (o *TimeGetNotFound) SetPayload(payload *models.ErrorResponse)

SetPayload sets the payload to the time get not found response

func (*TimeGetNotFound) WithPayload

func (o *TimeGetNotFound) WithPayload(payload *models.ErrorResponse) *TimeGetNotFound

WithPayload adds the payload to the time get not found response

func (*TimeGetNotFound) WriteResponse

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

WriteResponse to the client

type TimeGetOK

type TimeGetOK struct {

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

TimeGetOK Returns the time of day.

swagger:response timeGetOK

func NewTimeGetOK

func NewTimeGetOK() *TimeGetOK

NewTimeGetOK creates TimeGetOK with default headers values

func (*TimeGetOK) SetPayload

func (o *TimeGetOK) SetPayload(payload *models.Timeofday)

SetPayload sets the payload to the time get o k response

func (*TimeGetOK) WithPayload

func (o *TimeGetOK) WithPayload(payload *models.Timeofday) *TimeGetOK

WithPayload adds the payload to the time get o k response

func (*TimeGetOK) WriteResponse

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

WriteResponse to the client

type TimeGetParams

type TimeGetParams struct {

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

	/*Timezone to return
	  In: query
	*/
	Timezone *string
}

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

swagger:parameters TimeGet

func NewTimeGetParams

func NewTimeGetParams() TimeGetParams

NewTimeGetParams creates a new TimeGetParams object no default values defined in spec.

func (*TimeGetParams) BindRequest

func (o *TimeGetParams) 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 NewTimeGetParams() beforehand.

type TimeGetURL

type TimeGetURL struct {
	Timezone *string
	// contains filtered or unexported fields
}

TimeGetURL generates an URL for the time get operation

func (*TimeGetURL) Build

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

Build a url path and query string

func (*TimeGetURL) BuildFull

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

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

func (*TimeGetURL) Must

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

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

func (*TimeGetURL) SetBasePath

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

func (o *TimeGetURL) String() string

String returns the string representation of the path with query string

func (*TimeGetURL) StringFull

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

StringFull returns the string representation of a complete url

func (*TimeGetURL) WithBasePath

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

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 TimePost

type TimePost struct {
	Context *middleware.Context
	Handler TimePostHandler
}

TimePost swagger:route POST /time timePost

Returns time of day.

func NewTimePost

func NewTimePost(ctx *middleware.Context, handler TimePostHandler) *TimePost

NewTimePost creates a new http.Handler for the time post operation

func (*TimePost) ServeHTTP

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

type TimePostHandler

type TimePostHandler interface {
	Handle(TimePostParams) middleware.Responder
}

TimePostHandler interface for that can handle valid time post params

type TimePostHandlerFunc

type TimePostHandlerFunc func(TimePostParams) middleware.Responder

TimePostHandlerFunc turns a function with the right signature into a time post handler

func (TimePostHandlerFunc) Handle

Handle executing the request and returning a response

type TimePostInternalServerError

type TimePostInternalServerError struct {

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

TimePostInternalServerError Something has gone horribly wrong

swagger:response timePostInternalServerError

func NewTimePostInternalServerError

func NewTimePostInternalServerError() *TimePostInternalServerError

NewTimePostInternalServerError creates TimePostInternalServerError with default headers values

func (*TimePostInternalServerError) SetPayload

func (o *TimePostInternalServerError) SetPayload(payload *models.ErrorResponse)

SetPayload sets the payload to the time post internal server error response

func (*TimePostInternalServerError) WithPayload

WithPayload adds the payload to the time post internal server error response

func (*TimePostInternalServerError) WriteResponse

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

WriteResponse to the client

type TimePostNotFound

type TimePostNotFound struct {

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

TimePostNotFound Time zone not found

swagger:response timePostNotFound

func NewTimePostNotFound

func NewTimePostNotFound() *TimePostNotFound

NewTimePostNotFound creates TimePostNotFound with default headers values

func (*TimePostNotFound) SetPayload

func (o *TimePostNotFound) SetPayload(payload *models.ErrorResponse)

SetPayload sets the payload to the time post not found response

func (*TimePostNotFound) WithPayload

func (o *TimePostNotFound) WithPayload(payload *models.ErrorResponse) *TimePostNotFound

WithPayload adds the payload to the time post not found response

func (*TimePostNotFound) WriteResponse

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

WriteResponse to the client

type TimePostOK

type TimePostOK struct {

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

TimePostOK Returns the time of day.

swagger:response timePostOK

func NewTimePostOK

func NewTimePostOK() *TimePostOK

NewTimePostOK creates TimePostOK with default headers values

func (*TimePostOK) SetPayload

func (o *TimePostOK) SetPayload(payload *models.Timeofday)

SetPayload sets the payload to the time post o k response

func (*TimePostOK) WithPayload

func (o *TimePostOK) WithPayload(payload *models.Timeofday) *TimePostOK

WithPayload adds the payload to the time post o k response

func (*TimePostOK) WriteResponse

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

WriteResponse to the client

type TimePostParams

type TimePostParams struct {

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

	/*Timezone to return
	  In: body
	*/
	Timezone *models.Timezone
}

TimePostParams contains all the bound params for the time post operation typically these are obtained from a http.Request

swagger:parameters TimePost

func NewTimePostParams

func NewTimePostParams() TimePostParams

NewTimePostParams creates a new TimePostParams object no default values defined in spec.

func (*TimePostParams) BindRequest

func (o *TimePostParams) 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 NewTimePostParams() beforehand.

type TimePostURL

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

TimePostURL generates an URL for the time post operation

func (*TimePostURL) Build

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

Build a url path and query string

func (*TimePostURL) BuildFull

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

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

func (*TimePostURL) Must

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

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

func (*TimePostURL) SetBasePath

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

func (o *TimePostURL) String() string

String returns the string representation of the path with query string

func (*TimePostURL) StringFull

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

StringFull returns the string representation of a complete url

func (*TimePostURL) WithBasePath

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

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 TimeofdayAPI

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

	// TimeGetHandler sets the operation handler for the time get operation
	TimeGetHandler TimeGetHandler
	// TimePostHandler sets the operation handler for the time post operation
	TimePostHandler TimePostHandler

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

TimeofdayAPI Return the time of day. Timezone optional.

func NewTimeofdayAPI

func NewTimeofdayAPI(spec *loads.Document) *TimeofdayAPI

NewTimeofdayAPI creates a new Timeofday instance

func (*TimeofdayAPI) AuthenticatorsFor

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

AuthenticatorsFor gets the authenticators for the specified security schemes

func (*TimeofdayAPI) Authorizer

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

Authorizer returns the registered authorizer

func (*TimeofdayAPI) ConsumersFor

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

ConsumersFor gets the consumers for the specified media types

func (*TimeofdayAPI) Context

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

Context returns the middleware context for the timeofday API

func (*TimeofdayAPI) DefaultConsumes

func (o *TimeofdayAPI) DefaultConsumes() string

DefaultConsumes returns the default consumes media type

func (*TimeofdayAPI) DefaultProduces

func (o *TimeofdayAPI) DefaultProduces() string

DefaultProduces returns the default produces media type

func (*TimeofdayAPI) Formats

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

Formats returns the registered string formats

func (*TimeofdayAPI) HandlerFor

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

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

func (*TimeofdayAPI) Init

func (o *TimeofdayAPI) Init()

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

func (*TimeofdayAPI) ProducersFor

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

ProducersFor gets the producers for the specified media types

func (*TimeofdayAPI) RegisterConsumer

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

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

func (*TimeofdayAPI) RegisterFormat

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

RegisterFormat registers a custom format validator

func (*TimeofdayAPI) RegisterProducer

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

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

func (*TimeofdayAPI) Serve

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

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

ServeErrorFor gets a error handler for a given operation id

func (*TimeofdayAPI) SetDefaultConsumes

func (o *TimeofdayAPI) SetDefaultConsumes(mediaType string)

SetDefaultConsumes returns the default consumes media type

func (*TimeofdayAPI) SetDefaultProduces

func (o *TimeofdayAPI) SetDefaultProduces(mediaType string)

SetDefaultProduces sets the default produces media type

func (*TimeofdayAPI) SetSpec

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

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

func (*TimeofdayAPI) Validate

func (o *TimeofdayAPI) Validate() error

Validate validates the registrations in the TimeofdayAPI

Jump to

Keyboard shortcuts

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