Documentation ¶
Index ¶
- Constants
- type GetResults
- type GetResultsDefault
- func (o *GetResultsDefault) SetPayload(payload *models.Error)
- func (o *GetResultsDefault) SetStatusCode(code int)
- func (o *GetResultsDefault) WithPayload(payload *models.Error) *GetResultsDefault
- func (o *GetResultsDefault) WithStatusCode(code int) *GetResultsDefault
- func (o *GetResultsDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
- type GetResultsHandler
- type GetResultsHandlerFunc
- type GetResultsOK
- type GetResultsParams
- type GetResultsURL
- func (o *GetResultsURL) Build() (*url.URL, error)
- func (o *GetResultsURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *GetResultsURL) Must(u *url.URL, err error) *url.URL
- func (o *GetResultsURL) SetBasePath(bp string)
- func (o *GetResultsURL) String() string
- func (o *GetResultsURL) StringFull(scheme, host string) string
- func (o *GetResultsURL) WithBasePath(bp string) *GetResultsURL
- type PostTrack
- type PostTrackCreated
- type PostTrackDefault
- func (o *PostTrackDefault) SetPayload(payload *models.Error)
- func (o *PostTrackDefault) SetStatusCode(code int)
- func (o *PostTrackDefault) WithPayload(payload *models.Error) *PostTrackDefault
- func (o *PostTrackDefault) WithStatusCode(code int) *PostTrackDefault
- func (o *PostTrackDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
- type PostTrackHandler
- type PostTrackHandlerFunc
- type PostTrackParams
- type PostTrackURL
- func (o *PostTrackURL) Build() (*url.URL, error)
- func (o *PostTrackURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *PostTrackURL) Must(u *url.URL, err error) *url.URL
- func (o *PostTrackURL) SetBasePath(bp string)
- func (o *PostTrackURL) String() string
- func (o *PostTrackURL) StringFull(scheme, host string) string
- func (o *PostTrackURL) WithBasePath(bp string) *PostTrackURL
- type TrackCheckerAppAPI
- func (o *TrackCheckerAppAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
- func (o *TrackCheckerAppAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *TrackCheckerAppAPI) Authorizer() runtime.Authorizer
- func (o *TrackCheckerAppAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *TrackCheckerAppAPI) Context() *middleware.Context
- func (o *TrackCheckerAppAPI) DefaultConsumes() string
- func (o *TrackCheckerAppAPI) DefaultProduces() string
- func (o *TrackCheckerAppAPI) Formats() strfmt.Registry
- func (o *TrackCheckerAppAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *TrackCheckerAppAPI) Init()
- func (o *TrackCheckerAppAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *TrackCheckerAppAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *TrackCheckerAppAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *TrackCheckerAppAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *TrackCheckerAppAPI) Serve(builder middleware.Builder) http.Handler
- func (o *TrackCheckerAppAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *TrackCheckerAppAPI) SetDefaultConsumes(mediaType string)
- func (o *TrackCheckerAppAPI) SetDefaultProduces(mediaType string)
- func (o *TrackCheckerAppAPI) SetSpec(spec *loads.Document)
- func (o *TrackCheckerAppAPI) UseRedoc()
- func (o *TrackCheckerAppAPI) UseSwaggerUI()
- func (o *TrackCheckerAppAPI) Validate() error
Constants ¶
const GetResultsOKCode int = 200
GetResultsOKCode is the HTTP code returned for type GetResultsOK
const PostTrackCreatedCode int = 201
PostTrackCreatedCode is the HTTP code returned for type PostTrackCreated
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetResults ¶
type GetResults struct { Context *middleware.Context Handler GetResultsHandler }
GetResults swagger:route GET /track getResults
Tracking ¶
get tracking numbers results
func NewGetResults ¶
func NewGetResults(ctx *middleware.Context, handler GetResultsHandler) *GetResults
NewGetResults creates a new http.Handler for the get results operation
func (*GetResults) ServeHTTP ¶
func (o *GetResults) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type GetResultsDefault ¶
type GetResultsDefault struct { /* In: Body */ Payload *models.Error `json:"body,omitempty"` // contains filtered or unexported fields }
GetResultsDefault error
swagger:response getResultsDefault
func NewGetResultsDefault ¶
func NewGetResultsDefault(code int) *GetResultsDefault
NewGetResultsDefault creates GetResultsDefault with default headers values
func (*GetResultsDefault) SetPayload ¶
func (o *GetResultsDefault) SetPayload(payload *models.Error)
SetPayload sets the payload to the get results default response
func (*GetResultsDefault) SetStatusCode ¶
func (o *GetResultsDefault) SetStatusCode(code int)
SetStatusCode sets the status to the get results default response
func (*GetResultsDefault) WithPayload ¶
func (o *GetResultsDefault) WithPayload(payload *models.Error) *GetResultsDefault
WithPayload adds the payload to the get results default response
func (*GetResultsDefault) WithStatusCode ¶
func (o *GetResultsDefault) WithStatusCode(code int) *GetResultsDefault
WithStatusCode adds the status to the get results default response
func (*GetResultsDefault) WriteResponse ¶
func (o *GetResultsDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetResultsHandler ¶
type GetResultsHandler interface {
Handle(GetResultsParams) middleware.Responder
}
GetResultsHandler interface for that can handle valid get results params
type GetResultsHandlerFunc ¶
type GetResultsHandlerFunc func(GetResultsParams) middleware.Responder
GetResultsHandlerFunc turns a function with the right signature into a get results handler
func (GetResultsHandlerFunc) Handle ¶
func (fn GetResultsHandlerFunc) Handle(params GetResultsParams) middleware.Responder
Handle executing the request and returning a response
type GetResultsOK ¶
type GetResultsOK struct { /* In: Body */ Payload *models.TrackingResult `json:"body,omitempty"` }
GetResultsOK tracking result is found
swagger:response getResultsOK
func NewGetResultsOK ¶
func NewGetResultsOK() *GetResultsOK
NewGetResultsOK creates GetResultsOK with default headers values
func (*GetResultsOK) SetPayload ¶
func (o *GetResultsOK) SetPayload(payload *models.TrackingResult)
SetPayload sets the payload to the get results o k response
func (*GetResultsOK) WithPayload ¶
func (o *GetResultsOK) WithPayload(payload *models.TrackingResult) *GetResultsOK
WithPayload adds the payload to the get results o k response
func (*GetResultsOK) WriteResponse ¶
func (o *GetResultsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetResultsParams ¶
type GetResultsParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /*Tracking ID Required: true In: query */ ID string }
GetResultsParams contains all the bound params for the get results operation typically these are obtained from a http.Request
swagger:parameters getResults
func NewGetResultsParams ¶
func NewGetResultsParams() GetResultsParams
NewGetResultsParams creates a new GetResultsParams object
There are no default values defined in the spec.
func (*GetResultsParams) BindRequest ¶
func (o *GetResultsParams) 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 NewGetResultsParams() beforehand.
type GetResultsURL ¶
type GetResultsURL struct { ID string // contains filtered or unexported fields }
GetResultsURL generates an URL for the get results operation
func (*GetResultsURL) Build ¶
func (o *GetResultsURL) Build() (*url.URL, error)
Build a url path and query string
func (*GetResultsURL) BuildFull ¶
func (o *GetResultsURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*GetResultsURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*GetResultsURL) SetBasePath ¶
func (o *GetResultsURL) 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 (*GetResultsURL) String ¶
func (o *GetResultsURL) String() string
String returns the string representation of the path with query string
func (*GetResultsURL) StringFull ¶
func (o *GetResultsURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*GetResultsURL) WithBasePath ¶
func (o *GetResultsURL) WithBasePath(bp string) *GetResultsURL
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 PostTrack ¶
type PostTrack struct { Context *middleware.Context Handler PostTrackHandler }
PostTrack swagger:route POST /track postTrack
Tracking ¶
Create tracking request with some tracking numbers
func NewPostTrack ¶
func NewPostTrack(ctx *middleware.Context, handler PostTrackHandler) *PostTrack
NewPostTrack creates a new http.Handler for the post track operation
type PostTrackCreated ¶
type PostTrackCreated struct { /* In: Body */ Payload *models.RequestResult `json:"body,omitempty"` }
PostTrackCreated OK
swagger:response postTrackCreated
func NewPostTrackCreated ¶
func NewPostTrackCreated() *PostTrackCreated
NewPostTrackCreated creates PostTrackCreated with default headers values
func (*PostTrackCreated) SetPayload ¶
func (o *PostTrackCreated) SetPayload(payload *models.RequestResult)
SetPayload sets the payload to the post track created response
func (*PostTrackCreated) WithPayload ¶
func (o *PostTrackCreated) WithPayload(payload *models.RequestResult) *PostTrackCreated
WithPayload adds the payload to the post track created response
func (*PostTrackCreated) WriteResponse ¶
func (o *PostTrackCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type PostTrackDefault ¶
type PostTrackDefault struct { /* In: Body */ Payload *models.Error `json:"body,omitempty"` // contains filtered or unexported fields }
PostTrackDefault error
swagger:response postTrackDefault
func NewPostTrackDefault ¶
func NewPostTrackDefault(code int) *PostTrackDefault
NewPostTrackDefault creates PostTrackDefault with default headers values
func (*PostTrackDefault) SetPayload ¶
func (o *PostTrackDefault) SetPayload(payload *models.Error)
SetPayload sets the payload to the post track default response
func (*PostTrackDefault) SetStatusCode ¶
func (o *PostTrackDefault) SetStatusCode(code int)
SetStatusCode sets the status to the post track default response
func (*PostTrackDefault) WithPayload ¶
func (o *PostTrackDefault) WithPayload(payload *models.Error) *PostTrackDefault
WithPayload adds the payload to the post track default response
func (*PostTrackDefault) WithStatusCode ¶
func (o *PostTrackDefault) WithStatusCode(code int) *PostTrackDefault
WithStatusCode adds the status to the post track default response
func (*PostTrackDefault) WriteResponse ¶
func (o *PostTrackDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type PostTrackHandler ¶
type PostTrackHandler interface {
Handle(PostTrackParams) middleware.Responder
}
PostTrackHandler interface for that can handle valid post track params
type PostTrackHandlerFunc ¶
type PostTrackHandlerFunc func(PostTrackParams) middleware.Responder
PostTrackHandlerFunc turns a function with the right signature into a post track handler
func (PostTrackHandlerFunc) Handle ¶
func (fn PostTrackHandlerFunc) Handle(params PostTrackParams) middleware.Responder
Handle executing the request and returning a response
type PostTrackParams ¶
type PostTrackParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /*Request body Required: true In: body */ Body *models.TrackRequest }
PostTrackParams contains all the bound params for the post track operation typically these are obtained from a http.Request
swagger:parameters PostTrack
func NewPostTrackParams ¶
func NewPostTrackParams() PostTrackParams
NewPostTrackParams creates a new PostTrackParams object
There are no default values defined in the spec.
func (*PostTrackParams) BindRequest ¶
func (o *PostTrackParams) 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 NewPostTrackParams() beforehand.
type PostTrackURL ¶
type PostTrackURL struct {
// contains filtered or unexported fields
}
PostTrackURL generates an URL for the post track operation
func (*PostTrackURL) Build ¶
func (o *PostTrackURL) Build() (*url.URL, error)
Build a url path and query string
func (*PostTrackURL) BuildFull ¶
func (o *PostTrackURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*PostTrackURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*PostTrackURL) SetBasePath ¶
func (o *PostTrackURL) 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 (*PostTrackURL) String ¶
func (o *PostTrackURL) String() string
String returns the string representation of the path with query string
func (*PostTrackURL) StringFull ¶
func (o *PostTrackURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*PostTrackURL) WithBasePath ¶
func (o *PostTrackURL) WithBasePath(bp string) *PostTrackURL
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 TrackCheckerAppAPI ¶
type TrackCheckerAppAPI struct { Middleware func(middleware.Builder) http.Handler // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. // It has a default implementation 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 implementation 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 implementation 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 the following mime types: // - application/json JSONConsumer runtime.Consumer // JSONProducer registers a producer for the following mime types: // - application/json JSONProducer runtime.Producer // PostTrackHandler sets the operation handler for the post track operation PostTrackHandler PostTrackHandler // GetResultsHandler sets the operation handler for the get results operation GetResultsHandler GetResultsHandler // 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) // PreServerShutdown is called before the HTTP(S) server is shutdown // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic PreServerShutdown func() // 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 }
TrackCheckerAppAPI This is a server for tracking parcels
func NewTrackCheckerAppAPI ¶
func NewTrackCheckerAppAPI(spec *loads.Document) *TrackCheckerAppAPI
NewTrackCheckerAppAPI creates a new TrackCheckerApp instance
func (*TrackCheckerAppAPI) AddMiddlewareFor ¶
func (o *TrackCheckerAppAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
AddMiddlewareFor adds a http middleware to existing handler
func (*TrackCheckerAppAPI) AuthenticatorsFor ¶
func (o *TrackCheckerAppAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*TrackCheckerAppAPI) Authorizer ¶
func (o *TrackCheckerAppAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*TrackCheckerAppAPI) ConsumersFor ¶
func (o *TrackCheckerAppAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.
func (*TrackCheckerAppAPI) Context ¶
func (o *TrackCheckerAppAPI) Context() *middleware.Context
Context returns the middleware context for the track checker app API
func (*TrackCheckerAppAPI) DefaultConsumes ¶
func (o *TrackCheckerAppAPI) DefaultConsumes() string
DefaultConsumes returns the default consumes media type
func (*TrackCheckerAppAPI) DefaultProduces ¶
func (o *TrackCheckerAppAPI) DefaultProduces() string
DefaultProduces returns the default produces media type
func (*TrackCheckerAppAPI) Formats ¶
func (o *TrackCheckerAppAPI) Formats() strfmt.Registry
Formats returns the registered string formats
func (*TrackCheckerAppAPI) HandlerFor ¶
func (o *TrackCheckerAppAPI) HandlerFor(method, path string) (http.Handler, bool)
HandlerFor gets a http.Handler for the provided operation method and path
func (*TrackCheckerAppAPI) Init ¶
func (o *TrackCheckerAppAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*TrackCheckerAppAPI) ProducersFor ¶
func (o *TrackCheckerAppAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.
func (*TrackCheckerAppAPI) RegisterConsumer ¶
func (o *TrackCheckerAppAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*TrackCheckerAppAPI) RegisterFormat ¶
func (o *TrackCheckerAppAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
RegisterFormat registers a custom format validator
func (*TrackCheckerAppAPI) RegisterProducer ¶
func (o *TrackCheckerAppAPI) RegisterProducer(mediaType string, producer runtime.Producer)
RegisterProducer allows you to add (or override) a producer for a media type.
func (*TrackCheckerAppAPI) Serve ¶
func (o *TrackCheckerAppAPI) 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 (*TrackCheckerAppAPI) ServeErrorFor ¶
func (o *TrackCheckerAppAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*TrackCheckerAppAPI) SetDefaultConsumes ¶
func (o *TrackCheckerAppAPI) SetDefaultConsumes(mediaType string)
SetDefaultConsumes returns the default consumes media type
func (*TrackCheckerAppAPI) SetDefaultProduces ¶
func (o *TrackCheckerAppAPI) SetDefaultProduces(mediaType string)
SetDefaultProduces sets the default produces media type
func (*TrackCheckerAppAPI) SetSpec ¶
func (o *TrackCheckerAppAPI) SetSpec(spec *loads.Document)
SetSpec sets a spec that will be served for the clients.
func (*TrackCheckerAppAPI) UseRedoc ¶
func (o *TrackCheckerAppAPI) UseRedoc()
UseRedoc for documentation at /docs
func (*TrackCheckerAppAPI) UseSwaggerUI ¶
func (o *TrackCheckerAppAPI) UseSwaggerUI()
UseSwaggerUI for documentation at /docs
func (*TrackCheckerAppAPI) Validate ¶
func (o *TrackCheckerAppAPI) Validate() error
Validate validates the registrations in the TrackCheckerAppAPI