- Use Google Distroless images for all services (Go & Node.js). - Standardize documentation with [PROJECT-NAME].md. - Add .dockerignore and .gitignore to all projects. - Remove docker-compose.yml in favor of docker run instructions. - Fix Go version and dependency issues in observability, repo-integrations, and security-governance. - Add Podman support (fully qualified image names). - Update Dashboard to use Node.js static server for Distroless compatibility.
144 lines
3.7 KiB
Go
144 lines
3.7 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.30.0
|
|
|
|
package db
|
|
|
|
import (
|
|
"database/sql/driver"
|
|
"fmt"
|
|
|
|
"github.com/jackc/pgx/v5/pgtype"
|
|
)
|
|
|
|
type FindingStatus string
|
|
|
|
const (
|
|
FindingStatusOpen FindingStatus = "open"
|
|
FindingStatusResolved FindingStatus = "resolved"
|
|
FindingStatusIgnored FindingStatus = "ignored"
|
|
)
|
|
|
|
func (e *FindingStatus) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = FindingStatus(s)
|
|
case string:
|
|
*e = FindingStatus(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for FindingStatus: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullFindingStatus struct {
|
|
FindingStatus FindingStatus `json:"finding_status"`
|
|
Valid bool `json:"valid"` // Valid is true if FindingStatus is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullFindingStatus) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.FindingStatus, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.FindingStatus.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullFindingStatus) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.FindingStatus), nil
|
|
}
|
|
|
|
type RiskLevel string
|
|
|
|
const (
|
|
RiskLevelLow RiskLevel = "low"
|
|
RiskLevelMedium RiskLevel = "medium"
|
|
RiskLevelHigh RiskLevel = "high"
|
|
RiskLevelCritical RiskLevel = "critical"
|
|
)
|
|
|
|
func (e *RiskLevel) Scan(src interface{}) error {
|
|
switch s := src.(type) {
|
|
case []byte:
|
|
*e = RiskLevel(s)
|
|
case string:
|
|
*e = RiskLevel(s)
|
|
default:
|
|
return fmt.Errorf("unsupported scan type for RiskLevel: %T", src)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NullRiskLevel struct {
|
|
RiskLevel RiskLevel `json:"risk_level"`
|
|
Valid bool `json:"valid"` // Valid is true if RiskLevel is not NULL
|
|
}
|
|
|
|
// Scan implements the Scanner interface.
|
|
func (ns *NullRiskLevel) Scan(value interface{}) error {
|
|
if value == nil {
|
|
ns.RiskLevel, ns.Valid = "", false
|
|
return nil
|
|
}
|
|
ns.Valid = true
|
|
return ns.RiskLevel.Scan(value)
|
|
}
|
|
|
|
// Value implements the driver Valuer interface.
|
|
func (ns NullRiskLevel) Value() (driver.Value, error) {
|
|
if !ns.Valid {
|
|
return nil, nil
|
|
}
|
|
return string(ns.RiskLevel), nil
|
|
}
|
|
|
|
type AuditLog struct {
|
|
ID int64 `json:"id"`
|
|
Timestamp pgtype.Timestamptz `json:"timestamp"`
|
|
ActorID string `json:"actor_id"`
|
|
Action string `json:"action"`
|
|
ResourceType pgtype.Text `json:"resource_type"`
|
|
ResourceID pgtype.Text `json:"resource_id"`
|
|
Details []byte `json:"details"`
|
|
}
|
|
|
|
type Control struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
PolicyID pgtype.UUID `json:"policy_id"`
|
|
Name string `json:"name"`
|
|
Description pgtype.Text `json:"description"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type Finding struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
ControlID pgtype.UUID `json:"control_id"`
|
|
ResourceID string `json:"resource_id"`
|
|
Status FindingStatus `json:"status"`
|
|
Details []byte `json:"details"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type Policy struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
Description pgtype.Text `json:"description"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|
|
|
|
type SecurityProfile struct {
|
|
ID pgtype.UUID `json:"id"`
|
|
Name string `json:"name"`
|
|
RiskLevel RiskLevel `json:"risk_level"`
|
|
CreatedAt pgtype.Timestamptz `json:"created_at"`
|
|
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
|
|
}
|