Documentation
¶
Index ¶
- Constants
- type GrypeServerAPI
- func (o *GrypeServerAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
- func (o *GrypeServerAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
- func (o *GrypeServerAPI) Authorizer() runtime.Authorizer
- func (o *GrypeServerAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
- func (o *GrypeServerAPI) Context() *middleware.Context
- func (o *GrypeServerAPI) DefaultConsumes() string
- func (o *GrypeServerAPI) DefaultProduces() string
- func (o *GrypeServerAPI) Formats() strfmt.Registry
- func (o *GrypeServerAPI) HandlerFor(method, path string) (http.Handler, bool)
- func (o *GrypeServerAPI) Init()
- func (o *GrypeServerAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
- func (o *GrypeServerAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
- func (o *GrypeServerAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
- func (o *GrypeServerAPI) RegisterProducer(mediaType string, producer runtime.Producer)
- func (o *GrypeServerAPI) Serve(builder middleware.Builder) http.Handler
- func (o *GrypeServerAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
- func (o *GrypeServerAPI) SetDefaultConsumes(mediaType string)
- func (o *GrypeServerAPI) SetDefaultProduces(mediaType string)
- func (o *GrypeServerAPI) SetSpec(spec *loads.Document)
- func (o *GrypeServerAPI) UseRedoc()
- func (o *GrypeServerAPI) UseSwaggerUI()
- func (o *GrypeServerAPI) Validate() error
- type PostScanSBOM
- type PostScanSBOMDefault
- func (o *PostScanSBOMDefault) SetPayload(payload *models.APIResponse)
- func (o *PostScanSBOMDefault) SetStatusCode(code int)
- func (o *PostScanSBOMDefault) WithPayload(payload *models.APIResponse) *PostScanSBOMDefault
- func (o *PostScanSBOMDefault) WithStatusCode(code int) *PostScanSBOMDefault
- func (o *PostScanSBOMDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
- type PostScanSBOMHandler
- type PostScanSBOMHandlerFunc
- type PostScanSBOMOK
- type PostScanSBOMParams
- type PostScanSBOMURL
- func (o *PostScanSBOMURL) Build() (*url.URL, error)
- func (o *PostScanSBOMURL) BuildFull(scheme, host string) (*url.URL, error)
- func (o *PostScanSBOMURL) Must(u *url.URL, err error) *url.URL
- func (o *PostScanSBOMURL) SetBasePath(bp string)
- func (o *PostScanSBOMURL) String() string
- func (o *PostScanSBOMURL) StringFull(scheme, host string) string
- func (o *PostScanSBOMURL) WithBasePath(bp string) *PostScanSBOMURL
Constants ¶
const PostScanSBOMOKCode int = 200
PostScanSBOMOKCode is the HTTP code returned for type PostScanSBOMOK
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GrypeServerAPI ¶
type GrypeServerAPI 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 // PostScanSBOMHandler sets the operation handler for the post scan s b o m operation PostScanSBOMHandler PostScanSBOMHandler // 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 }
GrypeServerAPI the grype server API
func NewGrypeServerAPI ¶
func NewGrypeServerAPI(spec *loads.Document) *GrypeServerAPI
NewGrypeServerAPI creates a new GrypeServer instance
func (*GrypeServerAPI) AddMiddlewareFor ¶
func (o *GrypeServerAPI) AddMiddlewareFor(method, path string, builder middleware.Builder)
AddMiddlewareFor adds a http middleware to existing handler
func (*GrypeServerAPI) AuthenticatorsFor ¶
func (o *GrypeServerAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator
AuthenticatorsFor gets the authenticators for the specified security schemes
func (*GrypeServerAPI) Authorizer ¶
func (o *GrypeServerAPI) Authorizer() runtime.Authorizer
Authorizer returns the registered authorizer
func (*GrypeServerAPI) ConsumersFor ¶
func (o *GrypeServerAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer
ConsumersFor gets the consumers for the specified media types. MIME type parameters are ignored here.
func (*GrypeServerAPI) Context ¶
func (o *GrypeServerAPI) Context() *middleware.Context
Context returns the middleware context for the grype server API
func (*GrypeServerAPI) DefaultConsumes ¶
func (o *GrypeServerAPI) DefaultConsumes() string
DefaultConsumes returns the default consumes media type
func (*GrypeServerAPI) DefaultProduces ¶
func (o *GrypeServerAPI) DefaultProduces() string
DefaultProduces returns the default produces media type
func (*GrypeServerAPI) Formats ¶
func (o *GrypeServerAPI) Formats() strfmt.Registry
Formats returns the registered string formats
func (*GrypeServerAPI) HandlerFor ¶
func (o *GrypeServerAPI) HandlerFor(method, path string) (http.Handler, bool)
HandlerFor gets a http.Handler for the provided operation method and path
func (*GrypeServerAPI) Init ¶
func (o *GrypeServerAPI) Init()
Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit
func (*GrypeServerAPI) ProducersFor ¶
func (o *GrypeServerAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer
ProducersFor gets the producers for the specified media types. MIME type parameters are ignored here.
func (*GrypeServerAPI) RegisterConsumer ¶
func (o *GrypeServerAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer)
RegisterConsumer allows you to add (or override) a consumer for a media type.
func (*GrypeServerAPI) RegisterFormat ¶
func (o *GrypeServerAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator)
RegisterFormat registers a custom format validator
func (*GrypeServerAPI) RegisterProducer ¶
func (o *GrypeServerAPI) RegisterProducer(mediaType string, producer runtime.Producer)
RegisterProducer allows you to add (or override) a producer for a media type.
func (*GrypeServerAPI) Serve ¶
func (o *GrypeServerAPI) 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 (*GrypeServerAPI) ServeErrorFor ¶
func (o *GrypeServerAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error)
ServeErrorFor gets a error handler for a given operation id
func (*GrypeServerAPI) SetDefaultConsumes ¶
func (o *GrypeServerAPI) SetDefaultConsumes(mediaType string)
SetDefaultConsumes returns the default consumes media type
func (*GrypeServerAPI) SetDefaultProduces ¶
func (o *GrypeServerAPI) SetDefaultProduces(mediaType string)
SetDefaultProduces sets the default produces media type
func (*GrypeServerAPI) SetSpec ¶
func (o *GrypeServerAPI) SetSpec(spec *loads.Document)
SetSpec sets a spec that will be served for the clients.
func (*GrypeServerAPI) UseRedoc ¶
func (o *GrypeServerAPI) UseRedoc()
UseRedoc for documentation at /docs
func (*GrypeServerAPI) UseSwaggerUI ¶
func (o *GrypeServerAPI) UseSwaggerUI()
UseSwaggerUI for documentation at /docs
func (*GrypeServerAPI) Validate ¶
func (o *GrypeServerAPI) Validate() error
Validate validates the registrations in the GrypeServerAPI
type PostScanSBOM ¶
type PostScanSBOM struct { Context *middleware.Context Handler PostScanSBOMHandler }
PostScanSBOM swagger:route POST /scanSBOM postScanSBOM
Scan SBOM (Software Bill Of Materials) for vulnerabilities
func NewPostScanSBOM ¶
func NewPostScanSBOM(ctx *middleware.Context, handler PostScanSBOMHandler) *PostScanSBOM
NewPostScanSBOM creates a new http.Handler for the post scan s b o m operation
func (*PostScanSBOM) ServeHTTP ¶
func (o *PostScanSBOM) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type PostScanSBOMDefault ¶
type PostScanSBOMDefault struct { /* In: Body */ Payload *models.APIResponse `json:"body,omitempty"` // contains filtered or unexported fields }
PostScanSBOMDefault unknown error
swagger:response postScanSBOMDefault
func NewPostScanSBOMDefault ¶
func NewPostScanSBOMDefault(code int) *PostScanSBOMDefault
NewPostScanSBOMDefault creates PostScanSBOMDefault with default headers values
func (*PostScanSBOMDefault) SetPayload ¶
func (o *PostScanSBOMDefault) SetPayload(payload *models.APIResponse)
SetPayload sets the payload to the post scan s b o m default response
func (*PostScanSBOMDefault) SetStatusCode ¶
func (o *PostScanSBOMDefault) SetStatusCode(code int)
SetStatusCode sets the status to the post scan s b o m default response
func (*PostScanSBOMDefault) WithPayload ¶
func (o *PostScanSBOMDefault) WithPayload(payload *models.APIResponse) *PostScanSBOMDefault
WithPayload adds the payload to the post scan s b o m default response
func (*PostScanSBOMDefault) WithStatusCode ¶
func (o *PostScanSBOMDefault) WithStatusCode(code int) *PostScanSBOMDefault
WithStatusCode adds the status to the post scan s b o m default response
func (*PostScanSBOMDefault) WriteResponse ¶
func (o *PostScanSBOMDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type PostScanSBOMHandler ¶
type PostScanSBOMHandler interface {
Handle(PostScanSBOMParams) middleware.Responder
}
PostScanSBOMHandler interface for that can handle valid post scan s b o m params
type PostScanSBOMHandlerFunc ¶
type PostScanSBOMHandlerFunc func(PostScanSBOMParams) middleware.Responder
PostScanSBOMHandlerFunc turns a function with the right signature into a post scan s b o m handler
func (PostScanSBOMHandlerFunc) Handle ¶
func (fn PostScanSBOMHandlerFunc) Handle(params PostScanSBOMParams) middleware.Responder
Handle executing the request and returning a response
type PostScanSBOMOK ¶
type PostScanSBOMOK struct { /* In: Body */ Payload *models.Vulnerabilities `json:"body,omitempty"` }
PostScanSBOMOK Successful scan result of the provided SBOM
swagger:response postScanSBOMOK
func NewPostScanSBOMOK ¶
func NewPostScanSBOMOK() *PostScanSBOMOK
NewPostScanSBOMOK creates PostScanSBOMOK with default headers values
func (*PostScanSBOMOK) SetPayload ¶
func (o *PostScanSBOMOK) SetPayload(payload *models.Vulnerabilities)
SetPayload sets the payload to the post scan s b o m o k response
func (*PostScanSBOMOK) WithPayload ¶
func (o *PostScanSBOMOK) WithPayload(payload *models.Vulnerabilities) *PostScanSBOMOK
WithPayload adds the payload to the post scan s b o m o k response
func (*PostScanSBOMOK) WriteResponse ¶
func (o *PostScanSBOMOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)
WriteResponse to the client
type PostScanSBOMParams ¶
type PostScanSBOMParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` /* Required: true In: body */ Body *models.SBOM }
PostScanSBOMParams contains all the bound params for the post scan s b o m operation typically these are obtained from a http.Request
swagger:parameters PostScanSBOM
func NewPostScanSBOMParams ¶
func NewPostScanSBOMParams() PostScanSBOMParams
NewPostScanSBOMParams creates a new PostScanSBOMParams object
There are no default values defined in the spec.
func (*PostScanSBOMParams) BindRequest ¶
func (o *PostScanSBOMParams) 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 NewPostScanSBOMParams() beforehand.
type PostScanSBOMURL ¶
type PostScanSBOMURL struct {
// contains filtered or unexported fields
}
PostScanSBOMURL generates an URL for the post scan s b o m operation
func (*PostScanSBOMURL) Build ¶
func (o *PostScanSBOMURL) Build() (*url.URL, error)
Build a url path and query string
func (*PostScanSBOMURL) BuildFull ¶
func (o *PostScanSBOMURL) BuildFull(scheme, host string) (*url.URL, error)
BuildFull builds a full url with scheme, host, path and query string
func (*PostScanSBOMURL) Must ¶
Must is a helper function to panic when the url builder returns an error
func (*PostScanSBOMURL) SetBasePath ¶
func (o *PostScanSBOMURL) 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 (*PostScanSBOMURL) String ¶
func (o *PostScanSBOMURL) String() string
String returns the string representation of the path with query string
func (*PostScanSBOMURL) StringFull ¶
func (o *PostScanSBOMURL) StringFull(scheme, host string) string
StringFull returns the string representation of a complete url
func (*PostScanSBOMURL) WithBasePath ¶
func (o *PostScanSBOMURL) WithBasePath(bp string) *PostScanSBOMURL
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