sources

package
v1.1.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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

func NewGetSourceEndpoint(s Service) goa.Endpoint

NewGetSourceEndpoint returns an endpoint function that calls the method "Get source" of service "sources".

func NewGetSourceMTTREndpoint

func NewGetSourceMTTREndpoint(s Service) goa.Endpoint

NewGetSourceMTTREndpoint returns an endpoint function that calls the method "Get source MTTR" of service "sources".

func NewListFindingsBySourceEndpoint

func NewListFindingsBySourceEndpoint(s Service) goa.Endpoint

NewListFindingsBySourceEndpoint returns an endpoint function that calls the method "List findings by source" of service "sources".

func NewListSourcesEndpoint

func NewListSourcesEndpoint(s Service) goa.Endpoint

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 NewClient

func NewClient(listSources, getSource, listFindingsBySource, getSourceMTTR goa.Endpoint) *Client

NewClient initializes a "sources" service client given the endpoints.

func (*Client) GetSource

func (c *Client) GetSource(ctx context.Context, p *GetSourcePayload) (res *Source, err error)

GetSource calls the "Get source" endpoint of the "sources" service.

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

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "sources" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "sources" service 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 ResourceGroup struct {
	// Name of the resource group
	Name *string
	// Column names of the resource group in the order that should be rendered
	Attributes []string
	// List containing the resource rows as hashmap
	Resources []map[string]string
}

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.

type Sourcewithnotarget

type Sourcewithnotarget struct {
	// Source ID
	ID *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
}

type Target

type Target struct {
	// Target ID
	ID *string
	// Target identifier
	Identifier *string
	// List of teams associated with target
	Teams []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL