deploymentsql

package
v0.0.0-...-dc91eb8 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 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 CountForWorkloadParams

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

type CountStatusesForDeploymentIDsRow

type CountStatusesForDeploymentIDsRow struct {
	DeploymentID uuid.UUID
	Count        int64
}

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 ListForWorkloadParams

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

type ListResourcesForDeploymentParams

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

type ListStatusesForDeploymentParams

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

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)
	CountForTeam(ctx context.Context, teamSlug slug.Slug) (int64, error)
	CountForWorkload(ctx context.Context, arg CountForWorkloadParams) (int64, error)
	CountResourcesForDeployment(ctx context.Context, deploymentID uuid.UUID) (int64, error)
	CountStatusesForDeploymentIDs(ctx context.Context, deploymentIds []uuid.UUID) ([]*CountStatusesForDeploymentIDsRow, error)
	LatestDeploymentTimestampForWorkload(ctx context.Context, arg LatestDeploymentTimestampForWorkloadParams) (pgtype.Timestamptz, error)
	ListByIDs(ctx context.Context, ids []uuid.UUID) ([]*Deployment, error)
	ListByTeamSlug(ctx context.Context, arg ListByTeamSlugParams) ([]*Deployment, 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) ([]*Deployment, error)
	ListResourcesForDeployment(ctx context.Context, arg ListResourcesForDeploymentParams) ([]*DeploymentK8sResource, error)
	ListStatusesForDeployment(ctx context.Context, arg ListStatusesForDeploymentParams) ([]*DeploymentStatus, 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) CountForTeam

func (q *Queries) CountForTeam(ctx context.Context, teamSlug slug.Slug) (int64, error)

func (*Queries) CountForWorkload

func (q *Queries) CountForWorkload(ctx context.Context, arg CountForWorkloadParams) (int64, error)

func (*Queries) CountResourcesForDeployment

func (q *Queries) CountResourcesForDeployment(ctx context.Context, deploymentID uuid.UUID) (int64, error)

func (*Queries) CountStatusesForDeploymentIDs

func (q *Queries) CountStatusesForDeploymentIDs(ctx context.Context, deploymentIds []uuid.UUID) ([]*CountStatusesForDeploymentIDsRow, error)

func (*Queries) LatestDeploymentTimestampForWorkload

func (q *Queries) LatestDeploymentTimestampForWorkload(ctx context.Context, arg LatestDeploymentTimestampForWorkloadParams) (pgtype.Timestamptz, 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) ([]*Deployment, 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) ([]*Deployment, error)

func (*Queries) ListResourcesForDeployment

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

func (*Queries) ListStatusesForDeployment

func (q *Queries) ListStatusesForDeployment(ctx context.Context, arg ListStatusesForDeploymentParams) ([]*DeploymentStatus, 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