Documentation ¶
Index ¶
- type GruntsAPI
- func (o *GruntsAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *GruntsAPI) Authorizer() runtime.Authorizer
- func (o *GruntsAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *GruntsAPI) Context() *middleware.Context
- func (o *GruntsAPI) DefaultConsumes() string
- func (o *GruntsAPI) DefaultProduces() string
- func (o *GruntsAPI) Formats() strfmt.Registry
- func (o *GruntsAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *GruntsAPI) Init()
- func (o *GruntsAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *GruntsAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *GruntsAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *GruntsAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *GruntsAPI) Serve(builder middleware.Builder) http.Handler
- func (o *GruntsAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *GruntsAPI) SetDefaultConsumes(mediaType string)
- func (o *GruntsAPI) SetDefaultProduces(mediaType string)
- func (o *GruntsAPI) SetSpec(spec *loads.Document)
- func (o *GruntsAPI) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GruntsAPI ¶
type GruntsAPI 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 // RoleAuthAuth 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 RoleAuthAuth 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 // DeploymentCreateDeploymentHandler sets the operation handler for the create deployment operation DeploymentCreateDeploymentHandler deployment.CreateDeploymentHandler // DeploymentDeleteDeploymentHandler sets the operation handler for the delete deployment operation DeploymentDeleteDeploymentHandler deployment.DeleteDeploymentHandler // RulechainDeleteRuleChainHandler sets the operation handler for the delete rule chain operation RulechainDeleteRuleChainHandler rulechain.DeleteRuleChainHandler // RulechainDownloadRuleChainHandler sets the operation handler for the download rule chain operation RulechainDownloadRuleChainHandler rulechain.DownloadRuleChainHandler // DeploymentGetDeploymentHandler sets the operation handler for the get deployment operation DeploymentGetDeploymentHandler deployment.GetDeploymentHandler // DeploymentGetDeploymentsHandler sets the operation handler for the get deployments operation DeploymentGetDeploymentsHandler deployment.GetDeploymentsHandler // RulechainGetRuleChainHandler sets the operation handler for the get rule chain operation RulechainGetRuleChainHandler rulechain.GetRuleChainHandler // RulechainGetRuleChainMetadataHandler sets the operation handler for the get rule chain metadata operation RulechainGetRuleChainMetadataHandler rulechain.GetRuleChainMetadataHandler // RulechainGetRuleChainsHandler sets the operation handler for the get rule chains operation RulechainGetRuleChainsHandler rulechain.GetRuleChainsHandler // RulechainSaveRuleChainHandler sets the operation handler for the save rule chain operation RulechainSaveRuleChainHandler rulechain.SaveRuleChainHandler // RulechainSaveRuleChainMetadataHandler sets the operation handler for the save rule chain metadata operation RulechainSaveRuleChainMetadataHandler rulechain.SaveRuleChainMetadataHandler // DeploymentSetDeploymentStatusHandler sets the operation handler for the set deployment status operation DeploymentSetDeploymentStatusHandler deployment.SetDeploymentStatusHandler // RulechainSetRootRuleChainHandler sets the operation handler for the set root rule chain operation RulechainSetRootRuleChainHandler rulechain.SetRootRuleChainHandler // DeploymentUpdateDeploymentHandler sets the operation handler for the update deployment operation DeploymentUpdateDeploymentHandler deployment.UpdateDeploymentHandler // RulechainUploadRuleChainHandler sets the operation handler for the upload rule chain operation RulechainUploadRuleChainHandler rulechain.UploadRuleChainHandler // 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 }
GruntsAPI grunsts is a rule engine that can design and control data folow.
func NewGruntsAPI ¶
NewGruntsAPI creates a new Grunts instance
func (*GruntsAPI) AuthenticatorsFor ¶
func (o *GruntsAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*GruntsAPI) Authorizer ¶
func (o *GruntsAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*GruntsAPI) ConsumersFor ¶
ConsumersFor gets the consumers for the specified media types
func (*GruntsAPI) Context ¶
func (o *GruntsAPI) Context() *middleware.Context
Context returns the middleware context for the grunts API
func (*GruntsAPI) DefaultConsumes ¶
DefaultConsumes returns the default consumes media type
func (*GruntsAPI) DefaultProduces ¶
DefaultProduces returns the default produces media type
func (*GruntsAPI) HandlerFor ¶
HandlerFor gets a http.Handler for the provided operation method and path
func (*GruntsAPI) Init ¶
func (o *GruntsAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*GruntsAPI) ProducersFor ¶
ProducersFor gets the producers for the specified media types
func (*GruntsAPI) RegisterConsumer ¶
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*GruntsAPI) RegisterFormat ¶
RegisterFormat registers a custom format validator
func (*GruntsAPI) RegisterProducer ¶
RegisterProducer allows you to add (or override) a producer for a media type.
func (*GruntsAPI) Serve ¶
func (o *GruntsAPI) 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 (*GruntsAPI) ServeErrorFor ¶
func (o *GruntsAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*GruntsAPI) SetDefaultConsumes ¶
SetDefaultConsumes returns the default consumes media type
func (*GruntsAPI) SetDefaultProduces ¶
SetDefaultProduces sets the default produces media type