types

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBDriverTypeLocal    = "LOCAL"
	DBDriverTypePostgres = "POSTGRES"
)

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type DBConfig

type DBConfig struct {
	EnableInfoLogs bool   `json:"enable-info-logs"`
	DriverType     string `json:"driver-type,omitempty"`
	DBPassword     string `json:"-"`
	DBUser         string `json:"db-user,omitempty"`
	DBHost         string `json:"db-host,omitempty"`
	DBPort         string `json:"db-port,omitempty"`
	DBName         string `json:"db-name,omitempty"`

	LocalDBPath string `json:"local-db-path,omitempty"`
}

type Database

type Database interface {
	ScanResultsTable() ScanResultsTable
	ScanConfigsTable() ScanConfigsTable
	ScansTable() ScansTable
	TargetsTable() TargetsTable
	ScopesTable() ScopesTable
	FindingsTable() FindingsTable
}

type FindingsTable

type FindingsTable interface {
	GetFindings(params models.GetFindingsParams) (models.Findings, error)
	GetFinding(findingID models.FindingID, params models.GetFindingsFindingIDParams) (models.Finding, error)

	CreateFinding(finding models.Finding) (models.Finding, error)
	UpdateFinding(finding models.Finding) (models.Finding, error)
	SaveFinding(finding models.Finding) (models.Finding, error)

	DeleteFinding(findingID models.FindingID) error
}

type PreconditionFailedError added in v0.5.0

type PreconditionFailedError struct {
	Reason string
}

func (*PreconditionFailedError) Error added in v0.5.0

func (e *PreconditionFailedError) Error() string

type ScanConfigsTable

type ScanConfigsTable interface {
	GetScanConfigs(params models.GetScanConfigsParams) (models.ScanConfigs, error)
	GetScanConfig(scanConfigID models.ScanConfigID, params models.GetScanConfigsScanConfigIDParams) (models.ScanConfig, error)

	CreateScanConfig(scanConfig models.ScanConfig) (models.ScanConfig, error)
	UpdateScanConfig(scanConfig models.ScanConfig, params models.PatchScanConfigsScanConfigIDParams) (models.ScanConfig, error)
	SaveScanConfig(scanConfig models.ScanConfig, params models.PutScanConfigsScanConfigIDParams) (models.ScanConfig, error)

	DeleteScanConfig(scanConfigID models.ScanConfigID) error
}

type ScansTable

type ScansTable interface {
	GetScans(params models.GetScansParams) (models.Scans, error)
	GetScan(scanID models.ScanID, params models.GetScansScanIDParams) (models.Scan, error)

	CreateScan(scan models.Scan) (models.Scan, error)
	UpdateScan(scan models.Scan, params models.PatchScansScanIDParams) (models.Scan, error)
	SaveScan(scan models.Scan, params models.PutScansScanIDParams) (models.Scan, error)

	DeleteScan(scanID models.ScanID) error
}

type ScopesTable

type ScopesTable interface {
	GetScopes(params models.GetDiscoveryScopesParams) (models.Scopes, error)
	SetScopes(scopes models.Scopes) (models.Scopes, error)
}

type TargetsTable

type TargetsTable interface {
	GetTargets(params models.GetTargetsParams) (models.Targets, error)
	GetTarget(targetID models.TargetID, params models.GetTargetsTargetIDParams) (models.Target, error)

	CreateTarget(target models.Target) (models.Target, error)
	UpdateTarget(target models.Target, params models.PatchTargetsTargetIDParams) (models.Target, error)
	SaveTarget(target models.Target, params models.PutTargetsTargetIDParams) (models.Target, error)

	DeleteTarget(targetID models.TargetID) error
}

Jump to

Keyboard shortcuts

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