Documentation
¶
Index ¶
- Constants
- Variables
- func NewGetSourceEndpoint(s Service) goa.Endpoint
- func NewGetSourceMTTREndpoint(s Service) goa.Endpoint
- func NewListFindingsBySourceEndpoint(s Service) goa.Endpoint
- func NewListSourcesEndpoint(s Service) goa.Endpoint
- func NewViewedFindingCollection(res FindingCollection, view string) sourcesviews.FindingCollection
- func NewViewedSource(res *Source, view string) *sourcesviews.Source
- func NewViewedSourceCollection(res SourceCollection, view string) sourcesviews.SourceCollection
- type Client
- func (c *Client) GetSource(ctx context.Context, p *GetSourcePayload) (res *Source, err error)
- func (c *Client) GetSourceMTTR(ctx context.Context, p *GetSourceMTTRPayload) (res float32, err error)
- func (c *Client) ListFindingsBySource(ctx context.Context, p *ListFindingsBySourcePayload) (res FindingCollection, err error)
- func (c *Client) ListSources(ctx context.Context, p *ListSourcesPayload) (res SourceCollection, err error)
- type Endpoints
- type Finding
- type FindingCollection
- type GetSourceMTTRPayload
- type GetSourcePayload
- type Issue
- type ListFindingsBySourcePayload
- type ListSourcesPayload
- type ResourceGroup
- type Service
- type Source
- type SourceCollection
- type Sourcewithnotarget
- type Target
Constants ¶
const ServiceName = "sources"
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 = [4]string{"List sources", "Get source", "List findings by source", "Get source MTTR"}
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 NewGetSourceEndpoint ¶
NewGetSourceEndpoint returns an endpoint function that calls the method "Get source" of service "sources".
func NewGetSourceMTTREndpoint ¶
NewGetSourceMTTREndpoint returns an endpoint function that calls the method "Get source MTTR" of service "sources".
func NewListFindingsBySourceEndpoint ¶
NewListFindingsBySourceEndpoint returns an endpoint function that calls the method "List findings by source" of service "sources".
func NewListSourcesEndpoint ¶
NewListSourcesEndpoint returns an endpoint function that calls the method "List sources" of service "sources".
func NewViewedFindingCollection ¶
func NewViewedFindingCollection(res FindingCollection, view string) sourcesviews.FindingCollection
NewViewedFindingCollection initializes viewed result type FindingCollection from result type FindingCollection using the given view.
func NewViewedSource ¶
func NewViewedSource(res *Source, view string) *sourcesviews.Source
NewViewedSource initializes viewed result type Source from result type Source using the given view.
func NewViewedSourceCollection ¶
func NewViewedSourceCollection(res SourceCollection, view string) sourcesviews.SourceCollection
NewViewedSourceCollection initializes viewed result type SourceCollection from result type SourceCollection using the given view.
Types ¶
type Client ¶
type Client struct {
ListSourcesEndpoint goa.Endpoint
GetSourceEndpoint goa.Endpoint
ListFindingsBySourceEndpoint goa.Endpoint
GetSourceMTTREndpoint goa.Endpoint
}
Client is the "sources" service client.
func (*Client) GetSourceMTTR ¶
func (c *Client) GetSourceMTTR(ctx context.Context, p *GetSourceMTTRPayload) (res float32, err error)
GetSourceMTTR calls the "Get source MTTR" endpoint of the "sources" service.
func (*Client) ListFindingsBySource ¶
func (c *Client) ListFindingsBySource(ctx context.Context, p *ListFindingsBySourcePayload) (res FindingCollection, err error)
ListFindingsBySource calls the "List findings by source" endpoint of the "sources" service.
func (*Client) ListSources ¶
func (c *Client) ListSources(ctx context.Context, p *ListSourcesPayload) (res SourceCollection, err error)
ListSources calls the "List sources" endpoint of the "sources" service.
type Endpoints ¶
type Endpoints struct {
ListSources goa.Endpoint
GetSource goa.Endpoint
ListFindingsBySource goa.Endpoint
GetSourceMTTR goa.Endpoint
}
Endpoints wraps the "sources" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "sources" service with endpoints.
type Finding ¶
type Finding struct {
// Finding ID
ID *string
// Issue
Issue *Issue
// Target
Target *Target
// Source
Source *Sourcewithnotarget
// Finding details
Details *string
// Finding impact details
ImpactDetails *string
// Finding status. Can be 'OPEN' or 'FIXED'.
Status *string
// Finding severity score
Score *float32
// Other resources associated with the finding
Resources []*ResourceGroup
}
type FindingCollection ¶
type FindingCollection []*Finding
FindingCollection is the result type of the sources service List findings by source method.
func NewFindingCollection ¶
func NewFindingCollection(vres sourcesviews.FindingCollection) FindingCollection
NewFindingCollection initializes result type FindingCollection from viewed result type FindingCollection.
type GetSourceMTTRPayload ¶
type GetSourceMTTRPayload struct {
// Source ID
ID *string
}
GetSourceMTTRPayload is the payload type of the sources service Get source MTTR method.
type GetSourcePayload ¶
type GetSourcePayload struct {
// Source ID
ID *string
}
GetSourcePayload is the payload type of the sources service Get source method.
type Issue ¶
type Issue struct {
// Issue ID
ID *string
// Issue summary
Summary *string
// Common Weakness Enumeration ID
CweID *int
// Issue description
Description *string
// Recommendations to fix the issue
Recommendations []string
// Documentation reference for the issue
ReferenceLinks []string
// Labels associated with the issue
Labels []string
}
type ListFindingsBySourcePayload ¶
type ListFindingsBySourcePayload struct {
// Source ID
ID *string
// Finding status filter. Can be 'OPEN' or 'FIXED'.
Status *string
// Sorting criteria. Supported fields: score, -score (for descending order)
SortBy *string
// Number of page requested
Page *int
// Number of results per page
Size *int
}
ListFindingsBySourcePayload is the payload type of the sources service List findings by source method.
type ListSourcesPayload ¶
type ListSourcesPayload struct {
// Number of page requested
Page *int
// Number of results per page
Size *int
}
ListSourcesPayload is the payload type of the sources service List sources method.
type ResourceGroup ¶
type Service ¶
type Service interface {
// ListSources implements List sources.
ListSources(context.Context, *ListSourcesPayload) (res SourceCollection, err error)
// GetSource implements Get source.
GetSource(context.Context, *GetSourcePayload) (res *Source, err error)
// ListFindingsBySource implements List findings by source.
ListFindingsBySource(context.Context, *ListFindingsBySourcePayload) (res FindingCollection, err error)
// GetSourceMTTR implements Get source MTTR.
GetSourceMTTR(context.Context, *GetSourceMTTRPayload) (res float32, err error)
}
Sources endpoint.
type Source ¶
type Source struct {
// Source ID
ID *string
// Target ID
TargetID *string
// Source name
Name *string
// Source component
Component *string
// Source instance
Instance *string
// Source options
Options *string
// Time on which the source scanned the target
Time *string
}
Source is the result type of the sources service Get source method.
func NewSource ¶
func NewSource(vres *sourcesviews.Source) *Source
NewSource initializes result type Source from viewed result type Source.
type SourceCollection ¶
type SourceCollection []*Source
SourceCollection is the result type of the sources service List sources method.
func NewSourceCollection ¶
func NewSourceCollection(vres sourcesviews.SourceCollection) SourceCollection
NewSourceCollection initializes result type SourceCollection from viewed result type SourceCollection.