db

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const CleanupOldAuditLogs = `-- name: CleanupOldAuditLogs :exec
DELETE FROM audit_log
WHERE timestamp < $1
`
View Source
const CompleteDeployment = `` /* 464-byte string literal not displayed */
View Source
const CountRulesetsByStatus = `-- name: CountRulesetsByStatus :many
SELECT status, COUNT(*) as count
FROM rulesets 
WHERE environment = $1
GROUP BY status
`
View Source
const CreateAuditEntry = `` /* 589-byte string literal not displayed */
View Source
const CreateDeployment = `` /* 929-byte string literal not displayed */
View Source
const CreateRuleset = `` /* 743-byte string literal not displayed */
View Source
const DeactivateOldDeployments = `` /* 253-byte string literal not displayed */
View Source
const DeactivateRulesetVersions = `` /* 184-byte string literal not displayed */
View Source
const DeleteRuleset = `-- name: DeleteRuleset :exec
DELETE FROM rulesets 
WHERE id = $1
`
View Source
const DeleteRulesetByNameVersion = `-- name: DeleteRulesetByNameVersion :execrows
DELETE FROM rulesets
WHERE name = $1 AND version = $2
`
View Source
const GetActiveDeployment = `` /* 470-byte string literal not displayed */
View Source
const GetAuditLogs = `` /* 697-byte string literal not displayed */
View Source
const GetAuditLogsByResource = `` /* 360-byte string literal not displayed */
View Source
const GetAuditLogsBySession = `` /* 312-byte string literal not displayed */
View Source
const GetAuditLogsByTrace = `` /* 308-byte string literal not displayed */
View Source
const GetAuditLogsByUser = `` /* 336-byte string literal not displayed */
View Source
const GetAuditStats = `` /* 416-byte string literal not displayed */
View Source
const GetCanaryDeployments = `` /* 425-byte string literal not displayed */
View Source
const GetDeployment = `` /* 282-byte string literal not displayed */
View Source
const GetDeploymentByID = `` /* 257-byte string literal not displayed */
View Source
const GetDeploymentHistory = `` /* 433-byte string literal not displayed */
View Source
const GetDeploymentStats = `` /* 491-byte string literal not displayed */
View Source
const GetDeploymentsByRuleset = `` /* 429-byte string literal not displayed */
View Source
const GetEnvironmentDeployments = `` /* 487-byte string literal not displayed */
View Source
const GetFailedDeployments = `` /* 458-byte string literal not displayed */
View Source
const GetFailedOperations = `` /* 343-byte string literal not displayed */
View Source
const GetLatestDeploymentForRuleset = `` /* 456-byte string literal not displayed */
View Source
const GetLatestRuleset = `` /* 402-byte string literal not displayed */
View Source
const GetRecentErrorsCount = `` /* 126-byte string literal not displayed */
View Source
const GetRecentRulesets = `` /* 390-byte string literal not displayed */
View Source
const GetRuleset = `` /* 379-byte string literal not displayed */
View Source
const GetRulesetAnyEnvironment = `` /* 421-byte string literal not displayed */
View Source
const GetRulesetByID = `` /* 343-byte string literal not displayed */
View Source
const GetRulesetStats = `` /* 319-byte string literal not displayed */
View Source
const GetRulesetVersions = `` /* 296-byte string literal not displayed */
View Source
const GetRulesetVersionsAll = `` /* 506-byte string literal not displayed */
View Source
const GetRulesetsByGitCommit = `` /* 385-byte string literal not displayed */
View Source
const GetRulesetsByTags = `` /* 413-byte string literal not displayed */
View Source
const GetRulesetsByTeam = `` /* 404-byte string literal not displayed */
View Source
const GetSecurityEvents = `` /* 407-byte string literal not displayed */
View Source
const GetTopActions = `` /* 144-byte string literal not displayed */
View Source
const GetTopUsers = `` /* 182-byte string literal not displayed */
View Source
const HasActiveDeployments = `` /* 209-byte string literal not displayed */
View Source
const ListDeployments = `` /* 703-byte string literal not displayed */
View Source
const ListRulesets = `` /* 1141-byte string literal not displayed */
View Source
const SearchAuditLogs = `` /* 439-byte string literal not displayed */
View Source
const SearchRulesets = `` /* 642-byte string literal not displayed */
View Source
const SetDeploymentRollback = `` /* 359-byte string literal not displayed */
View Source
const UpdateDeploymentHealthCheck = `` /* 335-byte string literal not displayed */
View Source
const UpdateDeploymentStatus = `` /* 438-byte string literal not displayed */
View Source
const UpdateRuleset = `` /* 648-byte string literal not displayed */
View Source
const UpdateRulesetStatus = `` /* 431-byte string literal not displayed */
View Source
const UpsertRuleset = `` /* 1453-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditLog

type AuditLog struct {
	ID             uuid.UUID          `db:"id" json:"id"`
	Action         string             `db:"action" json:"action"`
	Resource       string             `db:"resource" json:"resource"`
	ResourceID     uuid.UUID          `db:"resource_id" json:"resource_id"`
	Version        pgtype.Text        `db:"version" json:"version"`
	Environment    pgtype.Text        `db:"environment" json:"environment"`
	UserID         pgtype.Text        `db:"user_id" json:"user_id"`
	UserEmail      pgtype.Text        `db:"user_email" json:"user_email"`
	IpAddress      net.IP             `db:"ip_address" json:"ip_address"`
	UserAgent      pgtype.Text        `db:"user_agent" json:"user_agent"`
	SessionID      pgtype.Text        `db:"session_id" json:"session_id"`
	Details        json.RawMessage    `db:"details" json:"details"`
	RequestID      pgtype.Text        `db:"request_id" json:"request_id"`
	TraceID        pgtype.Text        `db:"trace_id" json:"trace_id"`
	Result         string             `db:"result" json:"result"`
	ErrorMessage   pgtype.Text        `db:"error_message" json:"error_message"`
	DurationMs     pgtype.Int4        `db:"duration_ms" json:"duration_ms"`
	Timestamp      pgtype.Timestamptz `db:"timestamp" json:"timestamp"`
	MonthPartition pgtype.Int4        `db:"month_partition" json:"month_partition"`
}

type CountRulesetsByStatusRow

type CountRulesetsByStatusRow struct {
	Status RulesetStatus `db:"status" json:"status"`
	Count  int64         `db:"count" json:"count"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Deployment

type Deployment struct {
	ID                   uuid.UUID          `db:"id" json:"id"`
	RulesetID            uuid.UUID          `db:"ruleset_id" json:"ruleset_id"`
	Environment          string             `db:"environment" json:"environment"`
	Status               DeploymentStatus   `db:"status" json:"status"`
	Strategy             string             `db:"strategy" json:"strategy"`
	Config               json.RawMessage    `db:"config" json:"config"`
	HealthCheck          json.RawMessage    `db:"health_check" json:"health_check"`
	RollbackInfo         json.RawMessage    `db:"rollback_info" json:"rollback_info"`
	CanaryConfig         json.RawMessage    `db:"canary_config" json:"canary_config"`
	DeployedAt           pgtype.Timestamptz `db:"deployed_at" json:"deployed_at"`
	CompletedAt          pgtype.Timestamptz `db:"completed_at" json:"completed_at"`
	DeployedBy           pgtype.Text        `db:"deployed_by" json:"deployed_by"`
	DeploymentDurationMs pgtype.Int4        `db:"deployment_duration_ms" json:"deployment_duration_ms"`
	CreatedAt            pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt            pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
}

type DeploymentStatus

type DeploymentStatus string
const (
	DeploymentStatusPending     DeploymentStatus = "pending"
	DeploymentStatusDeploying   DeploymentStatus = "deploying"
	DeploymentStatusActive      DeploymentStatus = "active"
	DeploymentStatusCanary      DeploymentStatus = "canary"
	DeploymentStatusRollingBack DeploymentStatus = "rolling_back"
	DeploymentStatusFailed      DeploymentStatus = "failed"
	DeploymentStatusInactive    DeploymentStatus = "inactive"
)

func (*DeploymentStatus) Scan

func (e *DeploymentStatus) Scan(src interface{}) error

type Environment

type Environment struct {
	ID                  uuid.UUID          `db:"id" json:"id"`
	Name                string             `db:"name" json:"name"`
	Type                string             `db:"type" json:"type"`
	Config              json.RawMessage    `db:"config" json:"config"`
	Constraints         json.RawMessage    `db:"constraints" json:"constraints"`
	Approvers           []string           `db:"approvers" json:"approvers"`
	AutoDeploy          pgtype.Bool        `db:"auto_deploy" json:"auto_deploy"`
	RequireApproval     pgtype.Bool        `db:"require_approval" json:"require_approval"`
	MaxRuleComplexity   pgtype.Int4        `db:"max_rule_complexity" json:"max_rule_complexity"`
	PerformanceBudgetMs pgtype.Int4        `db:"performance_budget_ms" json:"performance_budget_ms"`
	CreatedAt           pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt           pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
}

type GetActiveDeploymentRow

type GetActiveDeploymentRow struct {
	ID                   uuid.UUID          `db:"id" json:"id"`
	RulesetID            uuid.UUID          `db:"ruleset_id" json:"ruleset_id"`
	Environment          string             `db:"environment" json:"environment"`
	Status               DeploymentStatus   `db:"status" json:"status"`
	Strategy             string             `db:"strategy" json:"strategy"`
	Config               json.RawMessage    `db:"config" json:"config"`
	HealthCheck          json.RawMessage    `db:"health_check" json:"health_check"`
	RollbackInfo         json.RawMessage    `db:"rollback_info" json:"rollback_info"`
	CanaryConfig         json.RawMessage    `db:"canary_config" json:"canary_config"`
	DeployedAt           pgtype.Timestamptz `db:"deployed_at" json:"deployed_at"`
	CompletedAt          pgtype.Timestamptz `db:"completed_at" json:"completed_at"`
	DeployedBy           pgtype.Text        `db:"deployed_by" json:"deployed_by"`
	DeploymentDurationMs pgtype.Int4        `db:"deployment_duration_ms" json:"deployment_duration_ms"`
	CreatedAt            pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt            pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
	RulesetName          string             `db:"ruleset_name" json:"ruleset_name"`
	RulesetVersion       string             `db:"ruleset_version" json:"ruleset_version"`
}

type GetAuditStatsRow

type GetAuditStatsRow struct {
	TotalEntries         int64   `db:"total_entries" json:"total_entries"`
	SuccessfulOperations int64   `db:"successful_operations" json:"successful_operations"`
	FailedOperations     int64   `db:"failed_operations" json:"failed_operations"`
	UniqueUsers          int64   `db:"unique_users" json:"unique_users"`
	UniqueActions        int64   `db:"unique_actions" json:"unique_actions"`
	AvgDurationMs        float64 `db:"avg_duration_ms" json:"avg_duration_ms"`
}

type GetCanaryDeploymentsRow

type GetCanaryDeploymentsRow struct {
	ID                   uuid.UUID          `db:"id" json:"id"`
	RulesetID            uuid.UUID          `db:"ruleset_id" json:"ruleset_id"`
	Environment          string             `db:"environment" json:"environment"`
	Status               DeploymentStatus   `db:"status" json:"status"`
	Strategy             string             `db:"strategy" json:"strategy"`
	Config               json.RawMessage    `db:"config" json:"config"`
	HealthCheck          json.RawMessage    `db:"health_check" json:"health_check"`
	RollbackInfo         json.RawMessage    `db:"rollback_info" json:"rollback_info"`
	CanaryConfig         json.RawMessage    `db:"canary_config" json:"canary_config"`
	DeployedAt           pgtype.Timestamptz `db:"deployed_at" json:"deployed_at"`
	CompletedAt          pgtype.Timestamptz `db:"completed_at" json:"completed_at"`
	DeployedBy           pgtype.Text        `db:"deployed_by" json:"deployed_by"`
	DeploymentDurationMs pgtype.Int4        `db:"deployment_duration_ms" json:"deployment_duration_ms"`
	CreatedAt            pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt            pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
	RulesetName          string             `db:"ruleset_name" json:"ruleset_name"`
	RulesetVersion       string             `db:"ruleset_version" json:"ruleset_version"`
}

type GetDeploymentHistoryRow

type GetDeploymentHistoryRow struct {
	ID                   uuid.UUID          `db:"id" json:"id"`
	RulesetID            uuid.UUID          `db:"ruleset_id" json:"ruleset_id"`
	Environment          string             `db:"environment" json:"environment"`
	Status               DeploymentStatus   `db:"status" json:"status"`
	Strategy             string             `db:"strategy" json:"strategy"`
	Config               json.RawMessage    `db:"config" json:"config"`
	HealthCheck          json.RawMessage    `db:"health_check" json:"health_check"`
	RollbackInfo         json.RawMessage    `db:"rollback_info" json:"rollback_info"`
	CanaryConfig         json.RawMessage    `db:"canary_config" json:"canary_config"`
	DeployedAt           pgtype.Timestamptz `db:"deployed_at" json:"deployed_at"`
	CompletedAt          pgtype.Timestamptz `db:"completed_at" json:"completed_at"`
	DeployedBy           pgtype.Text        `db:"deployed_by" json:"deployed_by"`
	DeploymentDurationMs pgtype.Int4        `db:"deployment_duration_ms" json:"deployment_duration_ms"`
	CreatedAt            pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt            pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
	RulesetName          string             `db:"ruleset_name" json:"ruleset_name"`
	RulesetVersion       string             `db:"ruleset_version" json:"ruleset_version"`
}

type GetDeploymentStatsRow

type GetDeploymentStatsRow struct {
	TotalDeployments        int64   `db:"total_deployments" json:"total_deployments"`
	ActiveDeployments       int64   `db:"active_deployments" json:"active_deployments"`
	FailedDeployments       int64   `db:"failed_deployments" json:"failed_deployments"`
	CanaryDeployments       int64   `db:"canary_deployments" json:"canary_deployments"`
	AvgDeploymentDurationMs float64 `db:"avg_deployment_duration_ms" json:"avg_deployment_duration_ms"`
	TotalEnvironments       int64   `db:"total_environments" json:"total_environments"`
}

type GetDeploymentsByRulesetRow

type GetDeploymentsByRulesetRow struct {
	ID                   uuid.UUID          `db:"id" json:"id"`
	RulesetID            uuid.UUID          `db:"ruleset_id" json:"ruleset_id"`
	Environment          string             `db:"environment" json:"environment"`
	Status               DeploymentStatus   `db:"status" json:"status"`
	Strategy             string             `db:"strategy" json:"strategy"`
	Config               json.RawMessage    `db:"config" json:"config"`
	HealthCheck          json.RawMessage    `db:"health_check" json:"health_check"`
	RollbackInfo         json.RawMessage    `db:"rollback_info" json:"rollback_info"`
	CanaryConfig         json.RawMessage    `db:"canary_config" json:"canary_config"`
	DeployedAt           pgtype.Timestamptz `db:"deployed_at" json:"deployed_at"`
	CompletedAt          pgtype.Timestamptz `db:"completed_at" json:"completed_at"`
	DeployedBy           pgtype.Text        `db:"deployed_by" json:"deployed_by"`
	DeploymentDurationMs pgtype.Int4        `db:"deployment_duration_ms" json:"deployment_duration_ms"`
	CreatedAt            pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt            pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
	RulesetName          string             `db:"ruleset_name" json:"ruleset_name"`
	RulesetVersion       string             `db:"ruleset_version" json:"ruleset_version"`
}

type GetEnvironmentDeploymentsRow

type GetEnvironmentDeploymentsRow struct {
	ID                   uuid.UUID          `db:"id" json:"id"`
	RulesetID            uuid.UUID          `db:"ruleset_id" json:"ruleset_id"`
	Environment          string             `db:"environment" json:"environment"`
	Status               DeploymentStatus   `db:"status" json:"status"`
	Strategy             string             `db:"strategy" json:"strategy"`
	Config               json.RawMessage    `db:"config" json:"config"`
	HealthCheck          json.RawMessage    `db:"health_check" json:"health_check"`
	RollbackInfo         json.RawMessage    `db:"rollback_info" json:"rollback_info"`
	CanaryConfig         json.RawMessage    `db:"canary_config" json:"canary_config"`
	DeployedAt           pgtype.Timestamptz `db:"deployed_at" json:"deployed_at"`
	CompletedAt          pgtype.Timestamptz `db:"completed_at" json:"completed_at"`
	DeployedBy           pgtype.Text        `db:"deployed_by" json:"deployed_by"`
	DeploymentDurationMs pgtype.Int4        `db:"deployment_duration_ms" json:"deployment_duration_ms"`
	CreatedAt            pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt            pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
	RulesetName          string             `db:"ruleset_name" json:"ruleset_name"`
	RulesetVersion       string             `db:"ruleset_version" json:"ruleset_version"`
}

type GetFailedDeploymentsRow

type GetFailedDeploymentsRow struct {
	ID                   uuid.UUID          `db:"id" json:"id"`
	RulesetID            uuid.UUID          `db:"ruleset_id" json:"ruleset_id"`
	Environment          string             `db:"environment" json:"environment"`
	Status               DeploymentStatus   `db:"status" json:"status"`
	Strategy             string             `db:"strategy" json:"strategy"`
	Config               json.RawMessage    `db:"config" json:"config"`
	HealthCheck          json.RawMessage    `db:"health_check" json:"health_check"`
	RollbackInfo         json.RawMessage    `db:"rollback_info" json:"rollback_info"`
	CanaryConfig         json.RawMessage    `db:"canary_config" json:"canary_config"`
	DeployedAt           pgtype.Timestamptz `db:"deployed_at" json:"deployed_at"`
	CompletedAt          pgtype.Timestamptz `db:"completed_at" json:"completed_at"`
	DeployedBy           pgtype.Text        `db:"deployed_by" json:"deployed_by"`
	DeploymentDurationMs pgtype.Int4        `db:"deployment_duration_ms" json:"deployment_duration_ms"`
	CreatedAt            pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt            pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
	RulesetName          string             `db:"ruleset_name" json:"ruleset_name"`
	RulesetVersion       string             `db:"ruleset_version" json:"ruleset_version"`
}

type GetLatestDeploymentForRulesetRow

type GetLatestDeploymentForRulesetRow struct {
	ID                   uuid.UUID          `db:"id" json:"id"`
	RulesetID            uuid.UUID          `db:"ruleset_id" json:"ruleset_id"`
	Environment          string             `db:"environment" json:"environment"`
	Status               DeploymentStatus   `db:"status" json:"status"`
	Strategy             string             `db:"strategy" json:"strategy"`
	Config               json.RawMessage    `db:"config" json:"config"`
	HealthCheck          json.RawMessage    `db:"health_check" json:"health_check"`
	RollbackInfo         json.RawMessage    `db:"rollback_info" json:"rollback_info"`
	CanaryConfig         json.RawMessage    `db:"canary_config" json:"canary_config"`
	DeployedAt           pgtype.Timestamptz `db:"deployed_at" json:"deployed_at"`
	CompletedAt          pgtype.Timestamptz `db:"completed_at" json:"completed_at"`
	DeployedBy           pgtype.Text        `db:"deployed_by" json:"deployed_by"`
	DeploymentDurationMs pgtype.Int4        `db:"deployment_duration_ms" json:"deployment_duration_ms"`
	CreatedAt            pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt            pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
	RulesetName          string             `db:"ruleset_name" json:"ruleset_name"`
	RulesetVersion       string             `db:"ruleset_version" json:"ruleset_version"`
}

type GetRulesetStatsRow

type GetRulesetStatsRow struct {
	TotalRulesets     int64 `db:"total_rulesets" json:"total_rulesets"`
	DeployedRulesets  int64 `db:"deployed_rulesets" json:"deployed_rulesets"`
	FailedRulesets    int64 `db:"failed_rulesets" json:"failed_rulesets"`
	UniqueRulesets    int64 `db:"unique_rulesets" json:"unique_rulesets"`
	TotalEnvironments int64 `db:"total_environments" json:"total_environments"`
}

type GetRulesetVersionsAllRow

type GetRulesetVersionsAllRow struct {
	Version      string             `db:"version" json:"version"`
	CreatedAt    pgtype.Timestamptz `db:"created_at" json:"created_at"`
	CreatedBy    string             `db:"created_by" json:"created_by"`
	GitCommit    string             `db:"git_commit" json:"git_commit"`
	IsActive     bool               `db:"is_active" json:"is_active"`
	DeployedEnvs []string           `db:"deployed_envs" json:"deployed_envs"`
}

type GetRulesetVersionsRow

type GetRulesetVersionsRow struct {
	Version    string             `db:"version" json:"version"`
	CreatedAt  pgtype.Timestamptz `db:"created_at" json:"created_at"`
	CreatedBy  pgtype.Text        `db:"created_by" json:"created_by"`
	GitCommit  pgtype.Text        `db:"git_commit" json:"git_commit"`
	Status     RulesetStatus      `db:"status" json:"status"`
	IsDeployed bool               `db:"is_deployed" json:"is_deployed"`
}

type GetTopActionsRow

type GetTopActionsRow struct {
	Action string `db:"action" json:"action"`
	Count  int64  `db:"count" json:"count"`
}

type GetTopUsersRow

type GetTopUsersRow struct {
	UserID      pgtype.Text `db:"user_id" json:"user_id"`
	UserEmail   pgtype.Text `db:"user_email" json:"user_email"`
	ActionCount int64       `db:"action_count" json:"action_count"`
}

type ListDeploymentsRow

type ListDeploymentsRow struct {
	ID                   uuid.UUID          `db:"id" json:"id"`
	RulesetID            uuid.UUID          `db:"ruleset_id" json:"ruleset_id"`
	Environment          string             `db:"environment" json:"environment"`
	Status               DeploymentStatus   `db:"status" json:"status"`
	Strategy             string             `db:"strategy" json:"strategy"`
	Config               json.RawMessage    `db:"config" json:"config"`
	HealthCheck          json.RawMessage    `db:"health_check" json:"health_check"`
	RollbackInfo         json.RawMessage    `db:"rollback_info" json:"rollback_info"`
	CanaryConfig         json.RawMessage    `db:"canary_config" json:"canary_config"`
	DeployedAt           pgtype.Timestamptz `db:"deployed_at" json:"deployed_at"`
	CompletedAt          pgtype.Timestamptz `db:"completed_at" json:"completed_at"`
	DeployedBy           pgtype.Text        `db:"deployed_by" json:"deployed_by"`
	DeploymentDurationMs pgtype.Int4        `db:"deployment_duration_ms" json:"deployment_duration_ms"`
	CreatedAt            pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt            pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
	RulesetName          string             `db:"ruleset_name" json:"ruleset_name"`
	RulesetVersion       string             `db:"ruleset_version" json:"ruleset_version"`
}

type ListRulesetsRow

type ListRulesetsRow struct {
	ID               uuid.UUID          `db:"id" json:"id"`
	Name             string             `db:"name" json:"name"`
	Version          string             `db:"version" json:"version"`
	Environment      string             `db:"environment" json:"environment"`
	Status           RulesetStatus      `db:"status" json:"status"`
	RulesetData      json.RawMessage    `db:"ruleset_data" json:"ruleset_data"`
	RuleCount        int32              `db:"rule_count" json:"rule_count"`
	Description      pgtype.Text        `db:"description" json:"description"`
	Tags             []string           `db:"tags" json:"tags"`
	Owner            pgtype.Text        `db:"owner" json:"owner"`
	Team             pgtype.Text        `db:"team" json:"team"`
	Metadata         json.RawMessage    `db:"metadata" json:"metadata"`
	GitCommit        pgtype.Text        `db:"git_commit" json:"git_commit"`
	GitBranch        pgtype.Text        `db:"git_branch" json:"git_branch"`
	GitTag           pgtype.Text        `db:"git_tag" json:"git_tag"`
	GitAuthor        pgtype.Text        `db:"git_author" json:"git_author"`
	PullRequest      pgtype.Text        `db:"pull_request" json:"pull_request"`
	CompiledAt       pgtype.Timestamptz `db:"compiled_at" json:"compiled_at"`
	CompilerVersion  pgtype.Text        `db:"compiler_version" json:"compiler_version"`
	SchemaVersion    pgtype.Text        `db:"schema_version" json:"schema_version"`
	ValidationHash   pgtype.Text        `db:"validation_hash" json:"validation_hash"`
	CreatedAt        pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
	CreatedBy        pgtype.Text        `db:"created_by" json:"created_by"`
	UpdatedBy        pgtype.Text        `db:"updated_by" json:"updated_by"`
	DeploymentStatus DeploymentStatus   `db:"deployment_status" json:"deployment_status"`
	LastDeployedAt   pgtype.Timestamptz `db:"last_deployed_at" json:"last_deployed_at"`
}

type NullDeploymentStatus

type NullDeploymentStatus struct {
	DeploymentStatus DeploymentStatus `json:"deployment_status"`
	Valid            bool             `json:"valid"` // Valid is true if DeploymentStatus is not NULL
}

func (*NullDeploymentStatus) Scan

func (ns *NullDeploymentStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullDeploymentStatus) Value

func (ns NullDeploymentStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullRuleType

type NullRuleType struct {
	RuleType RuleType `json:"rule_type"`
	Valid    bool     `json:"valid"` // Valid is true if RuleType is not NULL
}

func (*NullRuleType) Scan

func (ns *NullRuleType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullRuleType) Value

func (ns NullRuleType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullRulesetStatus

type NullRulesetStatus struct {
	RulesetStatus RulesetStatus `json:"ruleset_status"`
	Valid         bool          `json:"valid"` // Valid is true if RulesetStatus is not NULL
}

func (*NullRulesetStatus) Scan

func (ns *NullRulesetStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullRulesetStatus) Value

func (ns NullRulesetStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Querier

type Querier interface {
	CleanupOldAuditLogs(ctx context.Context, timestamp pgtype.Timestamptz) error
	CompleteDeployment(ctx context.Context, id uuid.UUID) (*Deployment, error)
	CountRulesetsByStatus(ctx context.Context, environment string) ([]*CountRulesetsByStatusRow, error)
	// Audit log queries for sqlc code generation
	CreateAuditEntry(ctx context.Context, action string, resource string, column3 string, version pgtype.Text, environment pgtype.Text, userID pgtype.Text, userEmail pgtype.Text, ipAddress net.IP, userAgent pgtype.Text, sessionID pgtype.Text, details json.RawMessage, requestID pgtype.Text, traceID pgtype.Text, result string, errorMessage pgtype.Text, durationMs pgtype.Int4) (*AuditLog, error)
	// Deployment queries for sqlc code generation
	CreateDeployment(ctx context.Context, rulesetID uuid.UUID, environment string, status DeploymentStatus, strategy string, config json.RawMessage, healthCheck json.RawMessage, rollbackInfo json.RawMessage, canaryConfig json.RawMessage, deployedBy pgtype.Text, deploymentDurationMs pgtype.Int4) (*Deployment, error)
	// Ruleset queries for sqlc code generation
	CreateRuleset(ctx context.Context, name string, version string, environment string, status RulesetStatus, rulesetData json.RawMessage, ruleCount int32, description pgtype.Text, tags []string, owner pgtype.Text, team pgtype.Text, metadata json.RawMessage, gitCommit pgtype.Text, gitBranch pgtype.Text, gitTag pgtype.Text, gitAuthor pgtype.Text, pullRequest pgtype.Text, compiledAt pgtype.Timestamptz, compilerVersion pgtype.Text, schemaVersion pgtype.Text, validationHash pgtype.Text, createdBy pgtype.Text, updatedBy pgtype.Text) (*Ruleset, error)
	DeactivateOldDeployments(ctx context.Context, name string, environment string, iD uuid.UUID) error
	DeactivateRulesetVersions(ctx context.Context, name string, environment string, iD uuid.UUID) error
	DeleteRuleset(ctx context.Context, id uuid.UUID) error
	DeleteRulesetByNameVersion(ctx context.Context, name string, version string) (int64, error)
	GetActiveDeployment(ctx context.Context, name string, environment string) (*GetActiveDeploymentRow, error)
	GetAuditLogs(ctx context.Context, column1 []string, column2 []string, column3 []string, column4 pgtype.Timestamptz, column5 pgtype.Timestamptz, column6 string, column7 string, limit int32, offset int32) ([]*AuditLog, error)
	GetAuditLogsByResource(ctx context.Context, resource string, column2 string, limit int32) ([]*AuditLog, error)
	GetAuditLogsBySession(ctx context.Context, sessionID pgtype.Text) ([]*AuditLog, error)
	GetAuditLogsByTrace(ctx context.Context, traceID pgtype.Text) ([]*AuditLog, error)
	GetAuditLogsByUser(ctx context.Context, userID pgtype.Text, timestamp pgtype.Timestamptz, limit int32) ([]*AuditLog, error)
	GetAuditStats(ctx context.Context, timestamp pgtype.Timestamptz) (*GetAuditStatsRow, error)
	GetCanaryDeployments(ctx context.Context) ([]*GetCanaryDeploymentsRow, error)
	GetDeployment(ctx context.Context, rulesetID uuid.UUID, environment string) (*Deployment, error)
	GetDeploymentByID(ctx context.Context, id uuid.UUID) (*Deployment, error)
	GetDeploymentHistory(ctx context.Context, environment string, limit int32) ([]*GetDeploymentHistoryRow, error)
	GetDeploymentStats(ctx context.Context, deployedAt pgtype.Timestamptz) (*GetDeploymentStatsRow, error)
	GetDeploymentsByRuleset(ctx context.Context, name string, limit int32) ([]*GetDeploymentsByRulesetRow, error)
	GetEnvironmentDeployments(ctx context.Context, environment string) ([]*GetEnvironmentDeploymentsRow, error)
	GetFailedDeployments(ctx context.Context, deployedAt pgtype.Timestamptz, limit int32) ([]*GetFailedDeploymentsRow, error)
	GetFailedOperations(ctx context.Context, timestamp pgtype.Timestamptz, limit int32) ([]*AuditLog, error)
	GetLatestDeploymentForRuleset(ctx context.Context, name string, environment string) (*GetLatestDeploymentForRulesetRow, error)
	GetLatestRuleset(ctx context.Context, name string, environment string) (*Ruleset, error)
	GetRecentErrorsCount(ctx context.Context, timestamp pgtype.Timestamptz) (int64, error)
	GetRecentRulesets(ctx context.Context, createdAt pgtype.Timestamptz, limit int32) ([]*Ruleset, error)
	GetRuleset(ctx context.Context, name string, version string, environment string) (*Ruleset, error)
	GetRulesetAnyEnvironment(ctx context.Context, name string, version string) (*Ruleset, error)
	GetRulesetByID(ctx context.Context, id uuid.UUID) (*Ruleset, error)
	GetRulesetStats(ctx context.Context) (*GetRulesetStatsRow, error)
	GetRulesetVersions(ctx context.Context, name string, environment string) ([]*GetRulesetVersionsRow, error)
	GetRulesetVersionsAll(ctx context.Context, name string) ([]*GetRulesetVersionsAllRow, error)
	GetRulesetsByGitCommit(ctx context.Context, gitCommit pgtype.Text) ([]*Ruleset, error)
	GetRulesetsByTags(ctx context.Context, column1 []string, environment string, limit int32) ([]*Ruleset, error)
	GetRulesetsByTeam(ctx context.Context, team pgtype.Text, environment string, limit int32) ([]*Ruleset, error)
	GetSecurityEvents(ctx context.Context, timestamp pgtype.Timestamptz, limit int32) ([]*AuditLog, error)
	GetTopActions(ctx context.Context, timestamp pgtype.Timestamptz, limit int32) ([]*GetTopActionsRow, error)
	GetTopUsers(ctx context.Context, timestamp pgtype.Timestamptz, limit int32) ([]*GetTopUsersRow, error)
	HasActiveDeployments(ctx context.Context, name string, version string) (bool, error)
	ListDeployments(ctx context.Context, column1 string, column2 []DeploymentStatus, column3 string, column4 pgtype.Timestamptz, column5 pgtype.Timestamptz, limit int32) ([]*ListDeploymentsRow, error)
	ListRulesets(ctx context.Context, column1 []string, column2 []string, column3 []RulesetStatus, column4 string, column5 string, column6 []string, column7 pgtype.Timestamptz, column8 string, column9 string, limit int32) ([]*ListRulesetsRow, error)
	SearchAuditLogs(ctx context.Context, plaintoTsquery string, timestamp pgtype.Timestamptz, limit int32) ([]*AuditLog, error)
	SearchRulesets(ctx context.Context, plaintoTsquery string, limit int32) ([]*SearchRulesetsRow, error)
	SetDeploymentRollback(ctx context.Context, iD uuid.UUID, rollbackInfo json.RawMessage) (*Deployment, error)
	UpdateDeploymentHealthCheck(ctx context.Context, iD uuid.UUID, healthCheck json.RawMessage) (*Deployment, error)
	UpdateDeploymentStatus(ctx context.Context, iD uuid.UUID, status DeploymentStatus) (*Deployment, error)
	UpdateRuleset(ctx context.Context, iD uuid.UUID, status RulesetStatus, rulesetData json.RawMessage, ruleCount int32, description pgtype.Text, tags []string, metadata json.RawMessage, updatedBy pgtype.Text) (*Ruleset, error)
	UpdateRulesetStatus(ctx context.Context, iD uuid.UUID, status RulesetStatus, updatedBy pgtype.Text) (*Ruleset, error)
	UpsertRuleset(ctx context.Context, name string, version string, environment string, status RulesetStatus, rulesetData json.RawMessage, ruleCount int32, description pgtype.Text, tags []string, owner pgtype.Text, team pgtype.Text, metadata json.RawMessage, gitCommit pgtype.Text, gitBranch pgtype.Text, gitTag pgtype.Text, gitAuthor pgtype.Text, pullRequest pgtype.Text, compiledAt pgtype.Timestamptz, compilerVersion pgtype.Text, schemaVersion pgtype.Text, validationHash pgtype.Text, createdBy pgtype.Text, updatedBy pgtype.Text) (*Ruleset, error)
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CleanupOldAuditLogs

func (q *Queries) CleanupOldAuditLogs(ctx context.Context, timestamp pgtype.Timestamptz) error

func (*Queries) CompleteDeployment

func (q *Queries) CompleteDeployment(ctx context.Context, id uuid.UUID) (*Deployment, error)

func (*Queries) CountRulesetsByStatus

func (q *Queries) CountRulesetsByStatus(ctx context.Context, environment string) ([]*CountRulesetsByStatusRow, error)

func (*Queries) CreateAuditEntry

func (q *Queries) CreateAuditEntry(ctx context.Context, action string, resource string, column3 string, version pgtype.Text, environment pgtype.Text, userID pgtype.Text, userEmail pgtype.Text, ipAddress net.IP, userAgent pgtype.Text, sessionID pgtype.Text, details json.RawMessage, requestID pgtype.Text, traceID pgtype.Text, result string, errorMessage pgtype.Text, durationMs pgtype.Int4) (*AuditLog, error)

Audit log queries for sqlc code generation

func (*Queries) CreateDeployment

func (q *Queries) CreateDeployment(ctx context.Context, rulesetID uuid.UUID, environment string, status DeploymentStatus, strategy string, config json.RawMessage, healthCheck json.RawMessage, rollbackInfo json.RawMessage, canaryConfig json.RawMessage, deployedBy pgtype.Text, deploymentDurationMs pgtype.Int4) (*Deployment, error)

Deployment queries for sqlc code generation

func (*Queries) CreateRuleset

func (q *Queries) CreateRuleset(ctx context.Context, name string, version string, environment string, status RulesetStatus, rulesetData json.RawMessage, ruleCount int32, description pgtype.Text, tags []string, owner pgtype.Text, team pgtype.Text, metadata json.RawMessage, gitCommit pgtype.Text, gitBranch pgtype.Text, gitTag pgtype.Text, gitAuthor pgtype.Text, pullRequest pgtype.Text, compiledAt pgtype.Timestamptz, compilerVersion pgtype.Text, schemaVersion pgtype.Text, validationHash pgtype.Text, createdBy pgtype.Text, updatedBy pgtype.Text) (*Ruleset, error)

Ruleset queries for sqlc code generation

func (*Queries) DeactivateOldDeployments

func (q *Queries) DeactivateOldDeployments(ctx context.Context, name string, environment string, iD uuid.UUID) error

func (*Queries) DeactivateRulesetVersions

func (q *Queries) DeactivateRulesetVersions(ctx context.Context, name string, environment string, iD uuid.UUID) error

func (*Queries) DeleteRuleset

func (q *Queries) DeleteRuleset(ctx context.Context, id uuid.UUID) error

func (*Queries) DeleteRulesetByNameVersion

func (q *Queries) DeleteRulesetByNameVersion(ctx context.Context, name string, version string) (int64, error)

func (*Queries) GetActiveDeployment

func (q *Queries) GetActiveDeployment(ctx context.Context, name string, environment string) (*GetActiveDeploymentRow, error)

func (*Queries) GetAuditLogs

func (q *Queries) GetAuditLogs(ctx context.Context, column1 []string, column2 []string, column3 []string, column4 pgtype.Timestamptz, column5 pgtype.Timestamptz, column6 string, column7 string, limit int32, offset int32) ([]*AuditLog, error)

func (*Queries) GetAuditLogsByResource

func (q *Queries) GetAuditLogsByResource(ctx context.Context, resource string, column2 string, limit int32) ([]*AuditLog, error)

func (*Queries) GetAuditLogsBySession

func (q *Queries) GetAuditLogsBySession(ctx context.Context, sessionID pgtype.Text) ([]*AuditLog, error)

func (*Queries) GetAuditLogsByTrace

func (q *Queries) GetAuditLogsByTrace(ctx context.Context, traceID pgtype.Text) ([]*AuditLog, error)

func (*Queries) GetAuditLogsByUser

func (q *Queries) GetAuditLogsByUser(ctx context.Context, userID pgtype.Text, timestamp pgtype.Timestamptz, limit int32) ([]*AuditLog, error)

func (*Queries) GetAuditStats

func (q *Queries) GetAuditStats(ctx context.Context, timestamp pgtype.Timestamptz) (*GetAuditStatsRow, error)

func (*Queries) GetCanaryDeployments

func (q *Queries) GetCanaryDeployments(ctx context.Context) ([]*GetCanaryDeploymentsRow, error)

func (*Queries) GetDeployment

func (q *Queries) GetDeployment(ctx context.Context, rulesetID uuid.UUID, environment string) (*Deployment, error)

func (*Queries) GetDeploymentByID

func (q *Queries) GetDeploymentByID(ctx context.Context, id uuid.UUID) (*Deployment, error)

func (*Queries) GetDeploymentHistory

func (q *Queries) GetDeploymentHistory(ctx context.Context, environment string, limit int32) ([]*GetDeploymentHistoryRow, error)

func (*Queries) GetDeploymentStats

func (q *Queries) GetDeploymentStats(ctx context.Context, deployedAt pgtype.Timestamptz) (*GetDeploymentStatsRow, error)

func (*Queries) GetDeploymentsByRuleset

func (q *Queries) GetDeploymentsByRuleset(ctx context.Context, name string, limit int32) ([]*GetDeploymentsByRulesetRow, error)

func (*Queries) GetEnvironmentDeployments

func (q *Queries) GetEnvironmentDeployments(ctx context.Context, environment string) ([]*GetEnvironmentDeploymentsRow, error)

func (*Queries) GetFailedDeployments

func (q *Queries) GetFailedDeployments(ctx context.Context, deployedAt pgtype.Timestamptz, limit int32) ([]*GetFailedDeploymentsRow, error)

func (*Queries) GetFailedOperations

func (q *Queries) GetFailedOperations(ctx context.Context, timestamp pgtype.Timestamptz, limit int32) ([]*AuditLog, error)

func (*Queries) GetLatestDeploymentForRuleset

func (q *Queries) GetLatestDeploymentForRuleset(ctx context.Context, name string, environment string) (*GetLatestDeploymentForRulesetRow, error)

func (*Queries) GetLatestRuleset

func (q *Queries) GetLatestRuleset(ctx context.Context, name string, environment string) (*Ruleset, error)

func (*Queries) GetRecentErrorsCount

func (q *Queries) GetRecentErrorsCount(ctx context.Context, timestamp pgtype.Timestamptz) (int64, error)

func (*Queries) GetRecentRulesets

func (q *Queries) GetRecentRulesets(ctx context.Context, createdAt pgtype.Timestamptz, limit int32) ([]*Ruleset, error)

func (*Queries) GetRuleset

func (q *Queries) GetRuleset(ctx context.Context, name string, version string, environment string) (*Ruleset, error)

func (*Queries) GetRulesetAnyEnvironment

func (q *Queries) GetRulesetAnyEnvironment(ctx context.Context, name string, version string) (*Ruleset, error)

func (*Queries) GetRulesetByID

func (q *Queries) GetRulesetByID(ctx context.Context, id uuid.UUID) (*Ruleset, error)

func (*Queries) GetRulesetStats

func (q *Queries) GetRulesetStats(ctx context.Context) (*GetRulesetStatsRow, error)

func (*Queries) GetRulesetVersions

func (q *Queries) GetRulesetVersions(ctx context.Context, name string, environment string) ([]*GetRulesetVersionsRow, error)

func (*Queries) GetRulesetVersionsAll

func (q *Queries) GetRulesetVersionsAll(ctx context.Context, name string) ([]*GetRulesetVersionsAllRow, error)

func (*Queries) GetRulesetsByGitCommit

func (q *Queries) GetRulesetsByGitCommit(ctx context.Context, gitCommit pgtype.Text) ([]*Ruleset, error)

func (*Queries) GetRulesetsByTags

func (q *Queries) GetRulesetsByTags(ctx context.Context, column1 []string, environment string, limit int32) ([]*Ruleset, error)

func (*Queries) GetRulesetsByTeam

func (q *Queries) GetRulesetsByTeam(ctx context.Context, team pgtype.Text, environment string, limit int32) ([]*Ruleset, error)

func (*Queries) GetSecurityEvents

func (q *Queries) GetSecurityEvents(ctx context.Context, timestamp pgtype.Timestamptz, limit int32) ([]*AuditLog, error)

func (*Queries) GetTopActions

func (q *Queries) GetTopActions(ctx context.Context, timestamp pgtype.Timestamptz, limit int32) ([]*GetTopActionsRow, error)

func (*Queries) GetTopUsers

func (q *Queries) GetTopUsers(ctx context.Context, timestamp pgtype.Timestamptz, limit int32) ([]*GetTopUsersRow, error)

func (*Queries) HasActiveDeployments

func (q *Queries) HasActiveDeployments(ctx context.Context, name string, version string) (bool, error)

func (*Queries) ListDeployments

func (q *Queries) ListDeployments(ctx context.Context, column1 string, column2 []DeploymentStatus, column3 string, column4 pgtype.Timestamptz, column5 pgtype.Timestamptz, limit int32) ([]*ListDeploymentsRow, error)

func (*Queries) ListRulesets

func (q *Queries) ListRulesets(ctx context.Context, column1 []string, column2 []string, column3 []RulesetStatus, column4 string, column5 string, column6 []string, column7 pgtype.Timestamptz, column8 string, column9 string, limit int32) ([]*ListRulesetsRow, error)

func (*Queries) SearchAuditLogs

func (q *Queries) SearchAuditLogs(ctx context.Context, plaintoTsquery string, timestamp pgtype.Timestamptz, limit int32) ([]*AuditLog, error)

func (*Queries) SearchRulesets

func (q *Queries) SearchRulesets(ctx context.Context, plaintoTsquery string, limit int32) ([]*SearchRulesetsRow, error)

func (*Queries) SetDeploymentRollback

func (q *Queries) SetDeploymentRollback(ctx context.Context, iD uuid.UUID, rollbackInfo json.RawMessage) (*Deployment, error)

func (*Queries) UpdateDeploymentHealthCheck

func (q *Queries) UpdateDeploymentHealthCheck(ctx context.Context, iD uuid.UUID, healthCheck json.RawMessage) (*Deployment, error)

func (*Queries) UpdateDeploymentStatus

func (q *Queries) UpdateDeploymentStatus(ctx context.Context, iD uuid.UUID, status DeploymentStatus) (*Deployment, error)

func (*Queries) UpdateRuleset

func (q *Queries) UpdateRuleset(ctx context.Context, iD uuid.UUID, status RulesetStatus, rulesetData json.RawMessage, ruleCount int32, description pgtype.Text, tags []string, metadata json.RawMessage, updatedBy pgtype.Text) (*Ruleset, error)

func (*Queries) UpdateRulesetStatus

func (q *Queries) UpdateRulesetStatus(ctx context.Context, iD uuid.UUID, status RulesetStatus, updatedBy pgtype.Text) (*Ruleset, error)

func (*Queries) UpsertRuleset

func (q *Queries) UpsertRuleset(ctx context.Context, name string, version string, environment string, status RulesetStatus, rulesetData json.RawMessage, ruleCount int32, description pgtype.Text, tags []string, owner pgtype.Text, team pgtype.Text, metadata json.RawMessage, gitCommit pgtype.Text, gitBranch pgtype.Text, gitTag pgtype.Text, gitAuthor pgtype.Text, pullRequest pgtype.Text, compiledAt pgtype.Timestamptz, compilerVersion pgtype.Text, schemaVersion pgtype.Text, validationHash pgtype.Text, createdBy pgtype.Text, updatedBy pgtype.Text) (*Ruleset, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type RuleMetric

type RuleMetric struct {
	ID              uuid.UUID          `db:"id" json:"id"`
	RulesetID       uuid.UUID          `db:"ruleset_id" json:"ruleset_id"`
	ExecutionCount  pgtype.Int8        `db:"execution_count" json:"execution_count"`
	SuccessCount    pgtype.Int8        `db:"success_count" json:"success_count"`
	ErrorCount      pgtype.Int8        `db:"error_count" json:"error_count"`
	TotalDurationMs pgtype.Int8        `db:"total_duration_ms" json:"total_duration_ms"`
	MinDurationMs   pgtype.Int4        `db:"min_duration_ms" json:"min_duration_ms"`
	MaxDurationMs   pgtype.Int4        `db:"max_duration_ms" json:"max_duration_ms"`
	AvgDurationMs   pgtype.Int4        `db:"avg_duration_ms" json:"avg_duration_ms"`
	MemoryUsageMb   pgtype.Int4        `db:"memory_usage_mb" json:"memory_usage_mb"`
	CpuUsagePercent pgtype.Numeric     `db:"cpu_usage_percent" json:"cpu_usage_percent"`
	LastExecutedAt  pgtype.Timestamptz `db:"last_executed_at" json:"last_executed_at"`
	CreatedAt       pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
}

type RuleType

type RuleType string
const (
	RuleTypeList RuleType = "list"
	RuleTypeFlow RuleType = "flow"
)

func (*RuleType) Scan

func (e *RuleType) Scan(src interface{}) error

type Ruleset

type Ruleset struct {
	ID              uuid.UUID          `db:"id" json:"id"`
	Name            string             `db:"name" json:"name"`
	Version         string             `db:"version" json:"version"`
	Environment     string             `db:"environment" json:"environment"`
	Status          RulesetStatus      `db:"status" json:"status"`
	RulesetData     json.RawMessage    `db:"ruleset_data" json:"ruleset_data"`
	RuleCount       int32              `db:"rule_count" json:"rule_count"`
	Description     pgtype.Text        `db:"description" json:"description"`
	Tags            []string           `db:"tags" json:"tags"`
	Owner           pgtype.Text        `db:"owner" json:"owner"`
	Team            pgtype.Text        `db:"team" json:"team"`
	Metadata        json.RawMessage    `db:"metadata" json:"metadata"`
	GitCommit       pgtype.Text        `db:"git_commit" json:"git_commit"`
	GitBranch       pgtype.Text        `db:"git_branch" json:"git_branch"`
	GitTag          pgtype.Text        `db:"git_tag" json:"git_tag"`
	GitAuthor       pgtype.Text        `db:"git_author" json:"git_author"`
	PullRequest     pgtype.Text        `db:"pull_request" json:"pull_request"`
	CompiledAt      pgtype.Timestamptz `db:"compiled_at" json:"compiled_at"`
	CompilerVersion pgtype.Text        `db:"compiler_version" json:"compiler_version"`
	SchemaVersion   pgtype.Text        `db:"schema_version" json:"schema_version"`
	ValidationHash  pgtype.Text        `db:"validation_hash" json:"validation_hash"`
	CreatedAt       pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
	CreatedBy       pgtype.Text        `db:"created_by" json:"created_by"`
	UpdatedBy       pgtype.Text        `db:"updated_by" json:"updated_by"`
}

type RulesetStatus

type RulesetStatus string
const (
	RulesetStatusDraft      RulesetStatus = "draft"
	RulesetStatusValidating RulesetStatus = "validating"
	RulesetStatusReady      RulesetStatus = "ready"
	RulesetStatusDeployed   RulesetStatus = "deployed"
	RulesetStatusDeprecated RulesetStatus = "deprecated"
	RulesetStatusFailed     RulesetStatus = "failed"
)

func (*RulesetStatus) Scan

func (e *RulesetStatus) Scan(src interface{}) error

type SearchRulesetsRow

type SearchRulesetsRow struct {
	ID              uuid.UUID          `db:"id" json:"id"`
	Name            string             `db:"name" json:"name"`
	Version         string             `db:"version" json:"version"`
	Environment     string             `db:"environment" json:"environment"`
	Status          RulesetStatus      `db:"status" json:"status"`
	RulesetData     json.RawMessage    `db:"ruleset_data" json:"ruleset_data"`
	RuleCount       int32              `db:"rule_count" json:"rule_count"`
	Description     pgtype.Text        `db:"description" json:"description"`
	Tags            []string           `db:"tags" json:"tags"`
	Owner           pgtype.Text        `db:"owner" json:"owner"`
	Team            pgtype.Text        `db:"team" json:"team"`
	Metadata        json.RawMessage    `db:"metadata" json:"metadata"`
	GitCommit       pgtype.Text        `db:"git_commit" json:"git_commit"`
	GitBranch       pgtype.Text        `db:"git_branch" json:"git_branch"`
	GitTag          pgtype.Text        `db:"git_tag" json:"git_tag"`
	GitAuthor       pgtype.Text        `db:"git_author" json:"git_author"`
	PullRequest     pgtype.Text        `db:"pull_request" json:"pull_request"`
	CompiledAt      pgtype.Timestamptz `db:"compiled_at" json:"compiled_at"`
	CompilerVersion pgtype.Text        `db:"compiler_version" json:"compiler_version"`
	SchemaVersion   pgtype.Text        `db:"schema_version" json:"schema_version"`
	ValidationHash  pgtype.Text        `db:"validation_hash" json:"validation_hash"`
	CreatedAt       pgtype.Timestamptz `db:"created_at" json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `db:"updated_at" json:"updated_at"`
	CreatedBy       pgtype.Text        `db:"created_by" json:"created_by"`
	UpdatedBy       pgtype.Text        `db:"updated_by" json:"updated_by"`
	Rank            float32            `db:"rank" json:"rank"`
}

Jump to

Keyboard shortcuts

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