Documentation ¶
Index ¶
Constants ¶
const ServiceName = "vulnerabilities"
ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.
Variables ¶
var MethodNames = [3]string{"find", "list", "submit"}
MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.
Functions ¶
func NewFindEndpoint ¶
NewFindEndpoint returns an endpoint function that calls the method "find" of service "vulnerabilities".
func NewListEndpoint ¶
NewListEndpoint returns an endpoint function that calls the method "list" of service "vulnerabilities".
func NewSubmitEndpoint ¶
NewSubmitEndpoint returns an endpoint function that calls the method "submit" of service "vulnerabilities".
Types ¶
type Client ¶
type Client struct { FindEndpoint endpoint.Endpoint ListEndpoint endpoint.Endpoint SubmitEndpoint endpoint.Endpoint }
Client is the "vulnerabilities" service client.
func (*Client) Find ¶
func (c *Client) Find(ctx context.Context, p *FindPayload) (res *Vulnerability, err error)
Find calls the "find" endpoint of the "vulnerabilities" service. Find may return the following errors:
- "no_match" (type NoMatch)
- error: internal error
func (*Client) List ¶
func (c *Client) List(ctx context.Context, p *LimitPayload) (res []*Vulnerability, err error)
List calls the "list" endpoint of the "vulnerabilities" service.
type Endpoints ¶
Endpoints wraps the "vulnerabilities" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "vulnerabilities" service with endpoints.
type FindPayload ¶
type FindPayload struct { // Unique ID of the vulnerability ID uint64 }
FindPayload is the payload type of the vulnerabilities service find method.
type LimitPayload ¶
type LimitPayload struct { // Limit the number of results Limit *int32 }
LimitPayload is the payload type of the vulnerabilities service list method.
type Service ¶
type Service interface { // Find implements find. Find(context.Context, *FindPayload) (res *Vulnerability, err error) // List all of the vulnerabilities List(context.Context, *LimitPayload) (res []*Vulnerability, err error) // Submit implements submit. Submit(context.Context, *SubmitPayload) (err error) }
The vulnerability service handles the creation and querying of security vulnerabilities.
type SubmitPayload ¶
type SubmitPayload struct { // Title of the vulnerability Title *string // Description of the vulnerability Description *string // If the vulnerability is exploitable Exploitable *bool // Severity score of the vulnerability CvssScore *float32 // If the vulnerability is patchable IsPatchable *bool // If the vulnerability is upgradeable IsUpgradeable *bool }
SubmitPayload is the payload type of the vulnerabilities service submit method.
type Vulnerability ¶
type Vulnerability struct { // Unique ID of the vulnerability ID uint64 // Title of the vulnerability Title *string // Description of the vulnerability Description *string // If the vulnerability is exploitable Exploitable *bool // Severity score of the vulnerability CvssScore *float32 // If the vulnerability is patchable IsPatchable *bool // If the vulnerability is upgradeable IsUpgradeable *bool }
Vulnerability is the result type of the vulnerabilities service find method.