Documentation ¶
Index ¶
- type Accepted
- type CheckRequest
- type Created
- type Endpoints
- type GetCheckResponse
- type GetChecksResponse
- type GetScanResponse
- type GetScanStatsResponse
- type GetScansResponse
- type HTTPResponse
- type HealthChecker
- type HealthcheckResponse
- type NoContent
- type Ok
- type ScanChecksRequest
- type ScanCreator
- type ScanEngineService
- type ScanGetter
- type ScanRequest
- type ScanResponse
- type ServerDown
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckRequest ¶
type CheckRequest struct {
ID string `json:"id" urlvar:"id"`
}
CheckRequest specifies the request for the get check endpoint.
type Created ¶
type Created struct {
Data interface{}
}
func (Created) MarshalJSON ¶
func (Created) StatusCode ¶
type Endpoints ¶
type Endpoints struct { Healthcheck endpoint.Endpoint CreateScan endpoint.Endpoint ListScans endpoint.Endpoint GetScan endpoint.Endpoint GetScanChecks endpoint.Endpoint GetScanStats endpoint.Endpoint GetCheck endpoint.Endpoint AbortScan endpoint.Endpoint }
Endpoints contains all available endpoints for this api
func MakeEndpoints ¶
func MakeEndpoints(s ScanEngineService) *Endpoints
MakeEndpoints initialize endpoints using the given service
type GetCheckResponse ¶
type GetCheckResponse struct { ID string `json:"id"` Status string `json:"status"` Target string `json:"target"` ChecktypeName string `json:"checktype_name,omitempty"` Image string `json:"image,omitempty"` Options string `json:"options,omitempty"` Report string `json:"report,omitempty"` Raw string `json:"raw,omitempty"` Tag string `json:"tag,omitempty"` Assettype string `json:"assettype,omitempty"` }
GetCheckResponse represents the response for a get check request.
type GetChecksResponse ¶
type GetChecksResponse struct {
Checks []GetCheckResponse `json:"checks"`
}
GetChecksResponse represents the response for a get scan checks request.
type GetScanResponse ¶
type GetScanResponse struct { ID string `json:"id"` ExternalID string `json:"external_id"` Status string `json:"status"` Trigger string `json:"trigger"` ScheduledTime *time.Time `json:"scheduled_time"` StartTime *time.Time `json:"start_time"` EndTime *time.Time `json:"end_time"` Progress *float32 `json:"progress"` CheckCount *int `json:"check_count"` ChecksCreated *int `json:"checks_created"` AbortedAt *time.Time `json:"aborted_at,omitempty"` }
GetScanResponse represents the response for a get scan request.
type GetScanStatsResponse ¶
type GetScanStatsResponse struct {
Checks []api.CheckStats `json:"checks"`
}
GetScanStatsResponse represents the response for a get scan checks stats request.
type GetScansResponse ¶
type GetScansResponse struct {
Scans []GetScanResponse `json:"scans"`
}
GetScansResponse represents the response for a list scans request.
type HTTPResponse ¶
type HTTPResponse interface {
StatusCode() int
}
type HealthChecker ¶
HealthChecker defines the services needed by the endpoint.
type HealthcheckResponse ¶
type HealthcheckResponse struct {
Status string `json:"status"`
}
type NoContent ¶
type NoContent struct {
Data interface{}
}
func (NoContent) MarshalJSON ¶
func (NoContent) StatusCode ¶
type ScanChecksRequest ¶
type ScanChecksRequest struct { ID string `json:"id" urlvar:"id"` Status string `json:"status" urlquery:"status"` }
ScanChecksRequest specifies the request for the get scan checks endpoint.
type ScanCreator ¶
ScanCreator defines the service interface required by the endpoint CreateScan
type ScanEngineService ¶
type ScanEngineService interface { HealthChecker ScanCreator ScanGetter }
ScanEngineService contains the services needed by all the endpoints.
type ScanGetter ¶
type ScanGetter interface { ListScans(ctx context.Context, extID string, offset, limit uint32) ([]api.Scan, error) GetScan(ctx context.Context, scanID string) (api.Scan, error) GetScanChecks(ctx context.Context, scanID, status string) ([]api.Check, error) GetScanStats(ctx context.Context, scanID string) ([]api.CheckStats, error) GetCheck(ctx context.Context, checkID string) (api.Check, error) AbortScan(ctx context.Context, scanID string) error }
ScanGetter defines the service interface required by the endpoint GetScan
type ScanRequest ¶
type ScanRequest struct { ID string `json:"id" urlvar:"id"` ExternalID string `json:"external_id" urlquery:"external_id"` ScheduledTime *time.Time `json:"scheduled_time"` // TODO: Remove TargetGroup and ChecktypeGroup when we deprecate the version 1 // of the endpoint for creating scans. TargetGroup api.TargetGroup `json:"target_group"` ChecktypesGroup api.ChecktypesGroup `json:"check_types_groups"` TargetGroups []api.TargetsChecktypesGroup `json:"target_groups"` Trigger string `json:"trigger"` Tag string `json:"tag,omitempty"` Offset string `urlquery:"offset"` Limit string `urlquery:"limit"` }
ScanRequest defines the request accepted by CreateScan endpoint.
type ScanResponse ¶
type ScanResponse struct {
ScanID string `json:"scan_id"`
}
ScanResponse represents the response for a scan creation request.
type ServerDown ¶
type ServerDown struct {
Data interface{}
}
func (ServerDown) MarshalJSON ¶
func (c ServerDown) MarshalJSON() ([]byte, error)
func (ServerDown) StatusCode ¶
func (c ServerDown) StatusCode() int