Documentation ¶
Index ¶
- Constants
- type Dht22MockAPI
- func (o *Dht22MockAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *Dht22MockAPI) Authorizer() runtime.Authorizer
- func (o *Dht22MockAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *Dht22MockAPI) Context() *middleware.Context
- func (o *Dht22MockAPI) DefaultConsumes() string
- func (o *Dht22MockAPI) DefaultProduces() string
- func (o *Dht22MockAPI) Formats() strfmt.Registry
- func (o *Dht22MockAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *Dht22MockAPI) Init()
- func (o *Dht22MockAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *Dht22MockAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *Dht22MockAPI) Serve(builder middleware.Builder) http.Handler
- func (o *Dht22MockAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *Dht22MockAPI) SetDefaultConsumes(mediaType string)
- func (o *Dht22MockAPI) SetDefaultProduces(mediaType string)
- func (o *Dht22MockAPI) SetSpec(spec *loads.Document)
- func (o *Dht22MockAPI) Validate() error
- type Get
- type GetConfig
- type GetConfigDefault
- func (o *GetConfigDefault) SetPayload(payload *models.ErrorResponse)
- func (o *GetConfigDefault) SetStatusCode(code int)
- func (o *GetConfigDefault) WithPayload(payload *models.ErrorResponse) *GetConfigDefault
- func (o *GetConfigDefault) WithStatusCode(code int) *GetConfigDefault
- func (o *GetConfigDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
- type GetConfigHandler
- type GetConfigHandlerFunc
- type GetConfigOK
- type GetConfigParams
- type GetConfigURL
- func (o *GetConfigURL) Build() (*url.URL, error)
- func (o *GetConfigURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *GetConfigURL) Must(u *url.URL, err error) *url.URL
- func (o *GetConfigURL) SetBasePath(bp string)
- func (o *GetConfigURL) String() string
- func (o *GetConfigURL) StringFull(scheme, host string) string
- func (o *GetConfigURL) WithBasePath(bp string) *GetConfigURL
- type GetDefault
- func (o *GetDefault) SetPayload(payload *models.ErrorResponse)
- func (o *GetDefault) SetStatusCode(code int)
- func (o *GetDefault) WithPayload(payload *models.ErrorResponse) *GetDefault
- func (o *GetDefault) WithStatusCode(code int) *GetDefault
- func (o *GetDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
- type GetHandler
- type GetHandlerFunc
- type GetOK
- type GetParams
- type GetURL
- func (o *GetURL) Build() (*url.URL, error)
- func (o *GetURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *GetURL) Must(u *url.URL, err error) *url.URL
- func (o *GetURL) SetBasePath(bp string)
- func (o *GetURL) String() string
- func (o *GetURL) StringFull(scheme, host string) string
- func (o *GetURL) WithBasePath(bp string) *GetURL
Constants ¶
const GetConfigOKCode int = 200
GetConfigOKCode is the HTTP code returned for type GetConfigOK
const GetOKCode int = 200
GetOKCode is the HTTP code returned for type GetOK
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dht22MockAPI ¶
type Dht22MockAPI 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 // GetHandler sets the operation handler for the get operation GetHandler GetHandler // GetConfigHandler sets the operation handler for the get config operation GetConfigHandler GetConfigHandler // 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 }
Dht22MockAPI the dht22 mock API
func NewDht22MockAPI ¶
func NewDht22MockAPI(spec *loads.Document) *Dht22MockAPI
NewDht22MockAPI creates a new Dht22Mock instance
func (*Dht22MockAPI) AuthenticatorsFor ¶
func (o *Dht22MockAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*Dht22MockAPI) Authorizer ¶
func (o *Dht22MockAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*Dht22MockAPI) ConsumersFor ¶
func (o *Dht22MockAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
ConsumersFor gets the consumers for the specified media types
func (*Dht22MockAPI) Context ¶
func (o *Dht22MockAPI) Context() *middleware.Context
Context returns the middleware context for the dht22 mock API
func (*Dht22MockAPI) DefaultConsumes ¶
func (o *Dht22MockAPI) DefaultConsumes() string
DefaultConsumes returns the default consumes media type
func (*Dht22MockAPI) DefaultProduces ¶
func (o *Dht22MockAPI) DefaultProduces() string
DefaultProduces returns the default produces media type
func (*Dht22MockAPI) Formats ¶
func (o *Dht22MockAPI) Formats() strfmt.Registry
Formats returns the registered string formats
func (*Dht22MockAPI) HandlerFor ¶
func (o *Dht22MockAPI) HandlerFor(method, path string) (http.Handler, bool)
HandlerFor gets a http.Handler for the provided operation method and path
func (*Dht22MockAPI) Init ¶
func (o *Dht22MockAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middelware as you see fit
func (*Dht22MockAPI) ProducersFor ¶
func (o *Dht22MockAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
ProducersFor gets the producers for the specified media types
func (*Dht22MockAPI) RegisterFormat ¶
func (o *Dht22MockAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
RegisterFormat registers a custom format validator
func (*Dht22MockAPI) Serve ¶
func (o *Dht22MockAPI) 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 (*Dht22MockAPI) ServeErrorFor ¶
func (o *Dht22MockAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*Dht22MockAPI) SetDefaultConsumes ¶
func (o *Dht22MockAPI) SetDefaultConsumes(mediaType string)
SetDefaultConsumes returns the default consumes media type
func (*Dht22MockAPI) SetDefaultProduces ¶
func (o *Dht22MockAPI) SetDefaultProduces(mediaType string)
SetDefaultProduces sets the default produces media type
func (*Dht22MockAPI) SetSpec ¶
func (o *Dht22MockAPI) SetSpec(spec *loads.Document)
SetSpec sets a spec that will be served for the clients.
func (*Dht22MockAPI) Validate ¶
func (o *Dht22MockAPI) Validate() error
Validate validates the registrations in the Dht22MockAPI
type Get ¶
type Get struct { Context *middleware.Context Handler GetHandler }
Get swagger:route GET / get
Returns the latest data from the DHT sensor
func NewGet ¶
func NewGet(ctx *middleware.Context, handler GetHandler) *Get
NewGet creates a new http.Handler for the get operation
type GetConfig ¶
type GetConfig struct { Context *middleware.Context Handler GetConfigHandler }
GetConfig swagger:route GET /config getConfig
Sets the SSID and password of a network
func NewGetConfig ¶
func NewGetConfig(ctx *middleware.Context, handler GetConfigHandler) *GetConfig
NewGetConfig creates a new http.Handler for the get config operation
type GetConfigDefault ¶
type GetConfigDefault struct { /* In: Body */ Payload *models.ErrorResponse `json:"body,omitempty"` // contains filtered or unexported fields }
GetConfigDefault Error
swagger:response getConfigDefault
func NewGetConfigDefault ¶
func NewGetConfigDefault(code int) *GetConfigDefault
NewGetConfigDefault creates GetConfigDefault with default headers values
func (*GetConfigDefault) SetPayload ¶
func (o *GetConfigDefault) SetPayload(payload *models.ErrorResponse)
SetPayload sets the payload to the get config default response
func (*GetConfigDefault) SetStatusCode ¶
func (o *GetConfigDefault) SetStatusCode(code int)
SetStatusCode sets the status to the get config default response
func (*GetConfigDefault) WithPayload ¶
func (o *GetConfigDefault) WithPayload(payload *models.ErrorResponse) *GetConfigDefault
WithPayload adds the payload to the get config default response
func (*GetConfigDefault) WithStatusCode ¶
func (o *GetConfigDefault) WithStatusCode(code int) *GetConfigDefault
WithStatusCode adds the status to the get config default response
func (*GetConfigDefault) WriteResponse ¶
func (o *GetConfigDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetConfigHandler ¶
type GetConfigHandler interface {
Handle(GetConfigParams) middleware.Responder
}
GetConfigHandler interface for that can handle valid get config params
type GetConfigHandlerFunc ¶
type GetConfigHandlerFunc func(GetConfigParams) middleware.Responder
GetConfigHandlerFunc turns a function with the right signature into a get config handler
func (GetConfigHandlerFunc) Handle ¶
func (fn GetConfigHandlerFunc) Handle(params GetConfigParams) middleware.Responder
Handle executing the request and returning a response
type GetConfigOK ¶
type GetConfigOK struct { /* In: Body */ Payload *models.ConfigResponse `json:"body,omitempty"` }
GetConfigOK Success
swagger:response getConfigOK
func NewGetConfigOK ¶
func NewGetConfigOK() *GetConfigOK
NewGetConfigOK creates GetConfigOK with default headers values
func (*GetConfigOK) SetPayload ¶
func (o *GetConfigOK) SetPayload(payload *models.ConfigResponse)
SetPayload sets the payload to the get config o k response
func (*GetConfigOK) WithPayload ¶
func (o *GetConfigOK) WithPayload(payload *models.ConfigResponse) *GetConfigOK
WithPayload adds the payload to the get config o k response
func (*GetConfigOK) WriteResponse ¶
func (o *GetConfigOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetConfigParams ¶
type GetConfigParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /* In: query */ Password *string /* Required: true In: query */ Ssid string }
GetConfigParams contains all the bound params for the get config operation typically these are obtained from a http.Request
swagger:parameters GetConfig
func NewGetConfigParams ¶
func NewGetConfigParams() GetConfigParams
NewGetConfigParams creates a new GetConfigParams object with the default values initialized.
func (*GetConfigParams) BindRequest ¶
func (o *GetConfigParams) 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
type GetConfigURL ¶
GetConfigURL generates an URL for the get config operation
func (*GetConfigURL) Build ¶
func (o *GetConfigURL) Build() (*url.URL, error)
Build a url path and query string
func (*GetConfigURL) BuildFull ¶
func (o *GetConfigURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*GetConfigURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*GetConfigURL) SetBasePath ¶
func (o *GetConfigURL) 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 (*GetConfigURL) String ¶
func (o *GetConfigURL) String() string
String returns the string representation of the path with query string
func (*GetConfigURL) StringFull ¶
func (o *GetConfigURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*GetConfigURL) WithBasePath ¶
func (o *GetConfigURL) WithBasePath(bp string) *GetConfigURL
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 GetDefault ¶
type GetDefault struct { /* In: Body */ Payload *models.ErrorResponse `json:"body,omitempty"` // contains filtered or unexported fields }
GetDefault Error
swagger:response getDefault
func NewGetDefault ¶
func NewGetDefault(code int) *GetDefault
NewGetDefault creates GetDefault with default headers values
func (*GetDefault) SetPayload ¶
func (o *GetDefault) SetPayload(payload *models.ErrorResponse)
SetPayload sets the payload to the get default response
func (*GetDefault) SetStatusCode ¶
func (o *GetDefault) SetStatusCode(code int)
SetStatusCode sets the status to the get default response
func (*GetDefault) WithPayload ¶
func (o *GetDefault) WithPayload(payload *models.ErrorResponse) *GetDefault
WithPayload adds the payload to the get default response
func (*GetDefault) WithStatusCode ¶
func (o *GetDefault) WithStatusCode(code int) *GetDefault
WithStatusCode adds the status to the get default response
func (*GetDefault) WriteResponse ¶
func (o *GetDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetHandler ¶
type GetHandler interface {
Handle(GetParams) middleware.Responder
}
GetHandler interface for that can handle valid get params
type GetHandlerFunc ¶
type GetHandlerFunc func(GetParams) middleware.Responder
GetHandlerFunc turns a function with the right signature into a get handler
func (GetHandlerFunc) Handle ¶
func (fn GetHandlerFunc) Handle(params GetParams) middleware.Responder
Handle executing the request and returning a response
type GetOK ¶
type GetOK struct { /* In: Body */ Payload *models.SensorData `json:"body,omitempty"` }
GetOK Success
swagger:response getOK
func (*GetOK) SetPayload ¶
func (o *GetOK) SetPayload(payload *models.SensorData)
SetPayload sets the payload to the get o k response
func (*GetOK) WithPayload ¶
func (o *GetOK) WithPayload(payload *models.SensorData) *GetOK
WithPayload adds the payload to the get o k response
func (*GetOK) WriteResponse ¶
func (o *GetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetParams ¶
GetParams contains all the bound params for the get operation typically these are obtained from a http.Request
swagger:parameters Get
func NewGetParams ¶
func NewGetParams() GetParams
NewGetParams creates a new GetParams object with the default values initialized.
func (*GetParams) BindRequest ¶
func (o *GetParams) 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
type GetURL ¶
type GetURL struct {
// contains filtered or unexported fields
}
GetURL generates an URL for the get operation
func (*GetURL) SetBasePath ¶
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 (*GetURL) StringFull ¶
StringFull returns the string representation of a complete url
func (*GetURL) 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