deploymentsql

package
v0.0.0-...-aa7570c Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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
	ExternalID       *string
	CreatedAt        pgtype.Timestamptz
	TeamSlug         slug.Slug
	Repository       *string
	CommitSha        *string
	DeployerUsername *string
	TriggerUrl       *string
	EnvironmentName  string
}

type DeploymentK8sResource

type DeploymentK8sResource struct {
	ID           uuid.UUID
	CreatedAt    pgtype.Timestamptz
	DeploymentID uuid.UUID
	Group        string
	Version      string
	Kind         string
	Name         string
	Namespace    string
}

type DeploymentState

type DeploymentState string
const (
	DeploymentStateSuccess    DeploymentState = "success"
	DeploymentStateError      DeploymentState = "error"
	DeploymentStateFailure    DeploymentState = "failure"
	DeploymentStateInactive   DeploymentState = "inactive"
	DeploymentStateInProgress DeploymentState = "in_progress"
	DeploymentStateQueued     DeploymentState = "queued"
	DeploymentStatePending    DeploymentState = "pending"
)

func AllDeploymentStateValues

func AllDeploymentStateValues() []DeploymentState

func (*DeploymentState) Scan

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

func (DeploymentState) Valid

func (e DeploymentState) Valid() bool

type DeploymentStatus

type DeploymentStatus struct {
	ID           uuid.UUID
	CreatedAt    pgtype.Timestamptz
	DeploymentID uuid.UUID
	State        DeploymentState
	Message      string
}

type LatestDeploymentTimestampForWorkloadParams

type LatestDeploymentTimestampForWorkloadParams struct {
	WorkloadName    string
	WorkloadKind    string
	EnvironmentName string
	TeamSlug        slug.Slug
}

type ListByTeamSlugParams

type ListByTeamSlugParams struct {
	TeamSlug slug.Slug
	Offset   int32
	Limit    int32
}

type ListByTeamSlugRow

type ListByTeamSlugRow struct {
	Deployment Deployment
	TotalCount int64
}

type ListForWorkloadParams

type ListForWorkloadParams struct {
	WorkloadName    string
	WorkloadKind    string
	EnvironmentName string
	TeamSlug        slug.Slug
	Offset          int32
	Limit           int32
}

type ListForWorkloadRow

type ListForWorkloadRow struct {
	Deployment Deployment
	TotalCount int64
}

type ListParams

type ListParams struct {
	Since        pgtype.Timestamptz
	Environments []string
	OrderBy      string
	Offset       int32
	Limit        int32
}

type ListResourcesForDeploymentParams

type ListResourcesForDeploymentParams struct {
	DeploymentID uuid.UUID
	Offset       int32
	Limit        int32
}

type ListResourcesForDeploymentRow

type ListResourcesForDeploymentRow struct {
	DeploymentK8sResource DeploymentK8sResource
	TotalCount            int64
}

type ListRow

type ListRow struct {
	Deployment Deployment
	TotalCount int64
}

type ListStatusesForDeploymentParams

type ListStatusesForDeploymentParams struct {
	DeploymentID uuid.UUID
	Offset       int32
	Limit        int32
}

type ListStatusesForDeploymentRow

type ListStatusesForDeploymentRow struct {
	DeploymentStatus DeploymentStatus
	TotalCount       int64
}

type NullDeploymentState

type NullDeploymentState struct {
	DeploymentState DeploymentState
	Valid           bool // Valid is true if DeploymentState is not NULL
}

func (*NullDeploymentState) Scan

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

Scan implements the Scanner interface.

func (NullDeploymentState) Value

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

Value implements the driver Valuer interface.

type Querier

type Querier interface {
	CleanupNaisVerification(ctx context.Context) (pgconn.CommandTag, error)
	LatestDeploymentTimestampForWorkload(ctx context.Context, arg LatestDeploymentTimestampForWorkloadParams) (pgtype.Timestamptz, error)
	List(ctx context.Context, arg ListParams) ([]*ListRow, error)
	ListByIDs(ctx context.Context, ids []uuid.UUID) ([]*Deployment, error)
	ListByTeamSlug(ctx context.Context, arg ListByTeamSlugParams) ([]*ListByTeamSlugRow, error)
	ListDeploymentResourcesByIDs(ctx context.Context, ids []uuid.UUID) ([]*DeploymentK8sResource, error)
	ListDeploymentStatusesByIDs(ctx context.Context, ids []uuid.UUID) ([]*DeploymentStatus, error)
	ListForWorkload(ctx context.Context, arg ListForWorkloadParams) ([]*ListForWorkloadRow, error)
	ListResourcesForDeployment(ctx context.Context, arg ListResourcesForDeploymentParams) ([]*ListResourcesForDeploymentRow, error)
	ListStatusesForDeployment(ctx context.Context, arg ListStatusesForDeploymentParams) ([]*ListStatusesForDeploymentRow, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CleanupNaisVerification

func (q *Queries) CleanupNaisVerification(ctx context.Context) (pgconn.CommandTag, error)

func (*Queries) LatestDeploymentTimestampForWorkload

func (q *Queries) LatestDeploymentTimestampForWorkload(ctx context.Context, arg LatestDeploymentTimestampForWorkloadParams) (pgtype.Timestamptz, error)

func (*Queries) List

func (q *Queries) List(ctx context.Context, arg ListParams) ([]*ListRow, error)

func (*Queries) ListByIDs

func (q *Queries) ListByIDs(ctx context.Context, ids []uuid.UUID) ([]*Deployment, error)

func (*Queries) ListByTeamSlug

func (q *Queries) ListByTeamSlug(ctx context.Context, arg ListByTeamSlugParams) ([]*ListByTeamSlugRow, error)

func (*Queries) ListDeploymentResourcesByIDs

func (q *Queries) ListDeploymentResourcesByIDs(ctx context.Context, ids []uuid.UUID) ([]*DeploymentK8sResource, error)

func (*Queries) ListDeploymentStatusesByIDs

func (q *Queries) ListDeploymentStatusesByIDs(ctx context.Context, ids []uuid.UUID) ([]*DeploymentStatus, error)

func (*Queries) ListForWorkload

func (q *Queries) ListForWorkload(ctx context.Context, arg ListForWorkloadParams) ([]*ListForWorkloadRow, error)

func (*Queries) ListResourcesForDeployment

func (q *Queries) ListResourcesForDeployment(ctx context.Context, arg ListResourcesForDeploymentParams) ([]*ListResourcesForDeploymentRow, error)

func (*Queries) ListStatusesForDeployment

func (q *Queries) ListStatusesForDeployment(ctx context.Context, arg ListStatusesForDeploymentParams) ([]*ListStatusesForDeploymentRow, error)

func (*Queries) WithTx

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

Jump to

Keyboard shortcuts

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