Documentation ¶
Index ¶
- Constants
- type GetAuthCallback
- type GetAuthCallbackDefault
- func (o *GetAuthCallbackDefault) SetPayload(payload *models.Error)
- func (o *GetAuthCallbackDefault) SetStatusCode(code int)
- func (o *GetAuthCallbackDefault) WithPayload(payload *models.Error) *GetAuthCallbackDefault
- func (o *GetAuthCallbackDefault) WithStatusCode(code int) *GetAuthCallbackDefault
- func (o *GetAuthCallbackDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
- type GetAuthCallbackHandler
- type GetAuthCallbackHandlerFunc
- type GetAuthCallbackOK
- type GetAuthCallbackOKBody
- type GetAuthCallbackParams
- type GetAuthCallbackURL
- func (o *GetAuthCallbackURL) Build() (*url.URL, error)
- func (o *GetAuthCallbackURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *GetAuthCallbackURL) Must(u *url.URL, err error) *url.URL
- func (o *GetAuthCallbackURL) SetBasePath(bp string)
- func (o *GetAuthCallbackURL) String() string
- func (o *GetAuthCallbackURL) StringFull(scheme, host string) string
- func (o *GetAuthCallbackURL) WithBasePath(bp string) *GetAuthCallbackURL
- type GetLogin
- type GetLoginDefault
- func (o *GetLoginDefault) SetPayload(payload *models.Error)
- func (o *GetLoginDefault) SetStatusCode(code int)
- func (o *GetLoginDefault) WithPayload(payload *models.Error) *GetLoginDefault
- func (o *GetLoginDefault) WithStatusCode(code int) *GetLoginDefault
- func (o *GetLoginDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
- type GetLoginHandler
- type GetLoginHandlerFunc
- type GetLoginOK
- type GetLoginOKBody
- type GetLoginParams
- type GetLoginURL
- func (o *GetLoginURL) Build() (*url.URL, error)
- func (o *GetLoginURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *GetLoginURL) Must(u *url.URL, err error) *url.URL
- func (o *GetLoginURL) SetBasePath(bp string)
- func (o *GetLoginURL) String() string
- func (o *GetLoginURL) StringFull(scheme, host string) string
- func (o *GetLoginURL) WithBasePath(bp string) *GetLoginURL
- type OauthSampleAPI
- func (o *OauthSampleAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
- func (o *OauthSampleAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *OauthSampleAPI) Authorizer() runtime.Authorizer
- func (o *OauthSampleAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *OauthSampleAPI) Context() *middleware.Context
- func (o *OauthSampleAPI) DefaultConsumes() string
- func (o *OauthSampleAPI) DefaultProduces() string
- func (o *OauthSampleAPI) Formats() strfmt.Registry
- func (o *OauthSampleAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *OauthSampleAPI) Init()
- func (o *OauthSampleAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *OauthSampleAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *OauthSampleAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *OauthSampleAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *OauthSampleAPI) Serve(builder middleware.Builder) http.Handler
- func (o *OauthSampleAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *OauthSampleAPI) SetDefaultConsumes(mediaType string)
- func (o *OauthSampleAPI) SetDefaultProduces(mediaType string)
- func (o *OauthSampleAPI) SetSpec(spec *loads.Document)
- func (o *OauthSampleAPI) UseRedoc()
- func (o *OauthSampleAPI) UseSwaggerUI()
- func (o *OauthSampleAPI) Validate() error
Constants ¶
const GetAuthCallbackOKCode int = 200
GetAuthCallbackOKCode is the HTTP code returned for type GetAuthCallbackOK
const GetLoginOKCode int = 200
GetLoginOKCode is the HTTP code returned for type GetLoginOK
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetAuthCallback ¶
type GetAuthCallback struct { Context *middleware.Context Handler GetAuthCallbackHandler }
GetAuthCallback swagger:route GET /auth/callback getAuthCallback
return access_token
func NewGetAuthCallback ¶
func NewGetAuthCallback(ctx *middleware.Context, handler GetAuthCallbackHandler) *GetAuthCallback
NewGetAuthCallback creates a new http.Handler for the get auth callback operation
func (*GetAuthCallback) ServeHTTP ¶
func (o *GetAuthCallback) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type GetAuthCallbackDefault ¶
type GetAuthCallbackDefault struct { /* In: Body */ Payload *models.Error `json:"body,omitempty"` // contains filtered or unexported fields }
GetAuthCallbackDefault error
swagger:response getAuthCallbackDefault
func NewGetAuthCallbackDefault ¶
func NewGetAuthCallbackDefault(code int) *GetAuthCallbackDefault
NewGetAuthCallbackDefault creates GetAuthCallbackDefault with default headers values
func (*GetAuthCallbackDefault) SetPayload ¶
func (o *GetAuthCallbackDefault) SetPayload(payload *models.Error)
SetPayload sets the payload to the get auth callback default response
func (*GetAuthCallbackDefault) SetStatusCode ¶
func (o *GetAuthCallbackDefault) SetStatusCode(code int)
SetStatusCode sets the status to the get auth callback default response
func (*GetAuthCallbackDefault) WithPayload ¶
func (o *GetAuthCallbackDefault) WithPayload(payload *models.Error) *GetAuthCallbackDefault
WithPayload adds the payload to the get auth callback default response
func (*GetAuthCallbackDefault) WithStatusCode ¶
func (o *GetAuthCallbackDefault) WithStatusCode(code int) *GetAuthCallbackDefault
WithStatusCode adds the status to the get auth callback default response
func (*GetAuthCallbackDefault) WriteResponse ¶
func (o *GetAuthCallbackDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetAuthCallbackHandler ¶
type GetAuthCallbackHandler interface {
Handle(GetAuthCallbackParams) middleware.Responder
}
GetAuthCallbackHandler interface for that can handle valid get auth callback params
type GetAuthCallbackHandlerFunc ¶
type GetAuthCallbackHandlerFunc func(GetAuthCallbackParams) middleware.Responder
GetAuthCallbackHandlerFunc turns a function with the right signature into a get auth callback handler
func (GetAuthCallbackHandlerFunc) Handle ¶
func (fn GetAuthCallbackHandlerFunc) Handle(params GetAuthCallbackParams) middleware.Responder
Handle executing the request and returning a response
type GetAuthCallbackOK ¶
type GetAuthCallbackOK struct { /* In: Body */ Payload *GetAuthCallbackOKBody `json:"body,omitempty"` }
GetAuthCallbackOK login
swagger:response getAuthCallbackOK
func NewGetAuthCallbackOK ¶
func NewGetAuthCallbackOK() *GetAuthCallbackOK
NewGetAuthCallbackOK creates GetAuthCallbackOK with default headers values
func (*GetAuthCallbackOK) SetPayload ¶
func (o *GetAuthCallbackOK) SetPayload(payload *GetAuthCallbackOKBody)
SetPayload sets the payload to the get auth callback o k response
func (*GetAuthCallbackOK) WithPayload ¶
func (o *GetAuthCallbackOK) WithPayload(payload *GetAuthCallbackOKBody) *GetAuthCallbackOK
WithPayload adds the payload to the get auth callback o k response
func (*GetAuthCallbackOK) WriteResponse ¶
func (o *GetAuthCallbackOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetAuthCallbackOKBody ¶
type GetAuthCallbackOKBody struct { // access token AccessToken string `json:"access_token,omitempty"` }
GetAuthCallbackOKBody get auth callback o k body
swagger:model GetAuthCallbackOKBody
func (*GetAuthCallbackOKBody) MarshalBinary ¶
func (o *GetAuthCallbackOKBody) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*GetAuthCallbackOKBody) UnmarshalBinary ¶
func (o *GetAuthCallbackOKBody) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
type GetAuthCallbackParams ¶
GetAuthCallbackParams contains all the bound params for the get auth callback operation typically these are obtained from a http.Request
swagger:parameters GetAuthCallback
func NewGetAuthCallbackParams ¶
func NewGetAuthCallbackParams() GetAuthCallbackParams
NewGetAuthCallbackParams creates a new GetAuthCallbackParams object no default values defined in spec.
func (*GetAuthCallbackParams) BindRequest ¶
func (o *GetAuthCallbackParams) 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 NewGetAuthCallbackParams() beforehand.
type GetAuthCallbackURL ¶
type GetAuthCallbackURL struct {
// contains filtered or unexported fields
}
GetAuthCallbackURL generates an URL for the get auth callback operation
func (*GetAuthCallbackURL) Build ¶
func (o *GetAuthCallbackURL) Build() (*url.URL, error)
Build a url path and query string
func (*GetAuthCallbackURL) BuildFull ¶
func (o *GetAuthCallbackURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*GetAuthCallbackURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*GetAuthCallbackURL) SetBasePath ¶
func (o *GetAuthCallbackURL) 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 (*GetAuthCallbackURL) String ¶
func (o *GetAuthCallbackURL) String() string
String returns the string representation of the path with query string
func (*GetAuthCallbackURL) StringFull ¶
func (o *GetAuthCallbackURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*GetAuthCallbackURL) WithBasePath ¶
func (o *GetAuthCallbackURL) WithBasePath(bp string) *GetAuthCallbackURL
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 GetLogin ¶
type GetLogin struct { Context *middleware.Context Handler GetLoginHandler }
GetLogin swagger:route GET /login getLogin
login through oauth2 server
func NewGetLogin ¶
func NewGetLogin(ctx *middleware.Context, handler GetLoginHandler) *GetLogin
NewGetLogin creates a new http.Handler for the get login operation
type GetLoginDefault ¶
type GetLoginDefault struct { /* In: Body */ Payload *models.Error `json:"body,omitempty"` // contains filtered or unexported fields }
GetLoginDefault error
swagger:response getLoginDefault
func NewGetLoginDefault ¶
func NewGetLoginDefault(code int) *GetLoginDefault
NewGetLoginDefault creates GetLoginDefault with default headers values
func (*GetLoginDefault) SetPayload ¶
func (o *GetLoginDefault) SetPayload(payload *models.Error)
SetPayload sets the payload to the get login default response
func (*GetLoginDefault) SetStatusCode ¶
func (o *GetLoginDefault) SetStatusCode(code int)
SetStatusCode sets the status to the get login default response
func (*GetLoginDefault) WithPayload ¶
func (o *GetLoginDefault) WithPayload(payload *models.Error) *GetLoginDefault
WithPayload adds the payload to the get login default response
func (*GetLoginDefault) WithStatusCode ¶
func (o *GetLoginDefault) WithStatusCode(code int) *GetLoginDefault
WithStatusCode adds the status to the get login default response
func (*GetLoginDefault) WriteResponse ¶
func (o *GetLoginDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetLoginHandler ¶
type GetLoginHandler interface {
Handle(GetLoginParams) middleware.Responder
}
GetLoginHandler interface for that can handle valid get login params
type GetLoginHandlerFunc ¶
type GetLoginHandlerFunc func(GetLoginParams) middleware.Responder
GetLoginHandlerFunc turns a function with the right signature into a get login handler
func (GetLoginHandlerFunc) Handle ¶
func (fn GetLoginHandlerFunc) Handle(params GetLoginParams) middleware.Responder
Handle executing the request and returning a response
type GetLoginOK ¶
type GetLoginOK struct { /* In: Body */ Payload *GetLoginOKBody `json:"body,omitempty"` }
GetLoginOK login
swagger:response getLoginOK
func NewGetLoginOK ¶
func NewGetLoginOK() *GetLoginOK
NewGetLoginOK creates GetLoginOK with default headers values
func (*GetLoginOK) SetPayload ¶
func (o *GetLoginOK) SetPayload(payload *GetLoginOKBody)
SetPayload sets the payload to the get login o k response
func (*GetLoginOK) WithPayload ¶
func (o *GetLoginOK) WithPayload(payload *GetLoginOKBody) *GetLoginOK
WithPayload adds the payload to the get login o k response
func (*GetLoginOK) WriteResponse ¶
func (o *GetLoginOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type GetLoginOKBody ¶
type GetLoginOKBody struct { // access token AccessToken string `json:"access_token,omitempty"` }
GetLoginOKBody get login o k body
swagger:model GetLoginOKBody
func (*GetLoginOKBody) MarshalBinary ¶
func (o *GetLoginOKBody) MarshalBinary() ([]byte, error)
MarshalBinary interface implementation
func (*GetLoginOKBody) UnmarshalBinary ¶
func (o *GetLoginOKBody) UnmarshalBinary(b []byte) error
UnmarshalBinary interface implementation
type GetLoginParams ¶
GetLoginParams contains all the bound params for the get login operation typically these are obtained from a http.Request
swagger:parameters GetLogin
func NewGetLoginParams ¶
func NewGetLoginParams() GetLoginParams
NewGetLoginParams creates a new GetLoginParams object no default values defined in spec.
func (*GetLoginParams) BindRequest ¶
func (o *GetLoginParams) 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 NewGetLoginParams() beforehand.
type GetLoginURL ¶
type GetLoginURL struct {
// contains filtered or unexported fields
}
GetLoginURL generates an URL for the get login operation
func (*GetLoginURL) Build ¶
func (o *GetLoginURL) Build() (*url.URL, error)
Build a url path and query string
func (*GetLoginURL) BuildFull ¶
func (o *GetLoginURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*GetLoginURL) SetBasePath ¶
func (o *GetLoginURL) 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 (*GetLoginURL) String ¶
func (o *GetLoginURL) String() string
String returns the string representation of the path with query string
func (*GetLoginURL) StringFull ¶
func (o *GetLoginURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*GetLoginURL) WithBasePath ¶
func (o *GetLoginURL) WithBasePath(bp string) *GetLoginURL
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 OauthSampleAPI ¶
type OauthSampleAPI 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 // OauthSecurityAuth 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 OauthSecurityAuth func(string, []string) (*models.Principal, error) // APIAuthorizer provides access control (ACL/RBAC/ABAC) by providing access to the request and authenticated principal APIAuthorizer runtime.Authorizer // GetAuthCallbackHandler sets the operation handler for the get auth callback operation GetAuthCallbackHandler GetAuthCallbackHandler // GetLoginHandler sets the operation handler for the get login operation GetLoginHandler GetLoginHandler // CustomersCreateHandler sets the operation handler for the create operation CustomersCreateHandler customers.CreateHandler // CustomersGetIDHandler sets the operation handler for the get Id operation CustomersGetIDHandler customers.GetIDHandler // 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 }
OauthSampleAPI the oauth sample API
func NewOauthSampleAPI ¶
func NewOauthSampleAPI(spec *loads.Document) *OauthSampleAPI
NewOauthSampleAPI creates a new OauthSample instance
func (*OauthSampleAPI) AddMiddlewareFor ¶ added in v0.26.0
func (o *OauthSampleAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
AddMiddlewareFor adds a http middleware to existing handler
func (*OauthSampleAPI) AuthenticatorsFor ¶
func (o *OauthSampleAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*OauthSampleAPI) Authorizer ¶
func (o *OauthSampleAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*OauthSampleAPI) ConsumersFor ¶
func (o *OauthSampleAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.
func (*OauthSampleAPI) Context ¶
func (o *OauthSampleAPI) Context() *middleware.Context
Context returns the middleware context for the oauth sample API
func (*OauthSampleAPI) DefaultConsumes ¶
func (o *OauthSampleAPI) DefaultConsumes() string
DefaultConsumes returns the default consumes media type
func (*OauthSampleAPI) DefaultProduces ¶
func (o *OauthSampleAPI) DefaultProduces() string
DefaultProduces returns the default produces media type
func (*OauthSampleAPI) Formats ¶
func (o *OauthSampleAPI) Formats() strfmt.Registry
Formats returns the registered string formats
func (*OauthSampleAPI) HandlerFor ¶
func (o *OauthSampleAPI) HandlerFor(method, path string) (http.Handler, bool)
HandlerFor gets a http.Handler for the provided operation method and path
func (*OauthSampleAPI) Init ¶
func (o *OauthSampleAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*OauthSampleAPI) ProducersFor ¶
func (o *OauthSampleAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.
func (*OauthSampleAPI) RegisterConsumer ¶
func (o *OauthSampleAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*OauthSampleAPI) RegisterFormat ¶
func (o *OauthSampleAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
RegisterFormat registers a custom format validator
func (*OauthSampleAPI) RegisterProducer ¶
func (o *OauthSampleAPI) RegisterProducer(mediaType string, producer runtime.Producer)
RegisterProducer allows you to add (or override) a producer for a media type.
func (*OauthSampleAPI) Serve ¶
func (o *OauthSampleAPI) 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 (*OauthSampleAPI) ServeErrorFor ¶
func (o *OauthSampleAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*OauthSampleAPI) SetDefaultConsumes ¶
func (o *OauthSampleAPI) SetDefaultConsumes(mediaType string)
SetDefaultConsumes returns the default consumes media type
func (*OauthSampleAPI) SetDefaultProduces ¶
func (o *OauthSampleAPI) SetDefaultProduces(mediaType string)
SetDefaultProduces sets the default produces media type
func (*OauthSampleAPI) SetSpec ¶
func (o *OauthSampleAPI) SetSpec(spec *loads.Document)
SetSpec sets a spec that will be served for the clients.
func (*OauthSampleAPI) UseRedoc ¶ added in v0.26.0
func (o *OauthSampleAPI) UseRedoc()
UseRedoc for documentation at /docs
func (*OauthSampleAPI) UseSwaggerUI ¶ added in v0.26.0
func (o *OauthSampleAPI) UseSwaggerUI()
UseSwaggerUI for documentation at /docs
func (*OauthSampleAPI) Validate ¶
func (o *OauthSampleAPI) Validate() error
Validate validates the registrations in the OauthSampleAPI