runrecency

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExpectationNotFound = xerror.NotFound(xerror.Pipeline).Detail("run recency expectation not found")

Functions

This section is empty.

Types

type Episode

type Episode struct {
	Slug                                            slug.Slug
	ExpectationID, DeploymentID, DeploymentRevision int64
	Deadline, BreachedAt                            time.Time
	LastSuccessAt                                   *time.Time
	LastSuccessRun                                  *string
}

type EpisodeEvidence

type EpisodeEvidence struct {
	Episode
	ExpectationRevision           int64
	MaximumAge                    time.Duration
	EnabledAt                     time.Time
	VersionSpecHash               string
	ResolutionDigest              *string
	DeployedAt                    time.Time
	ResolvedAt                    *time.Time
	ResolutionReason, RecoveryRun *string
	RecoverySucceededAt           *time.Time
}

EpisodeEvidence retains the identities recorded when a breach was observed.

type Expectation

type Expectation struct {
	ScopeDisabled bool
	ID            int64
	Scope
	EnvironmentID                               int64
	Revision                                    int64
	MaximumAge                                  time.Duration
	Enabled                                     bool
	EnabledAt                                   time.Time
	DeploymentID, DeploymentRevision, VersionID int64
	ResolutionDigest                            *string
	VersionSpecHash                             *string
	DeployedAt                                  time.Time
	SuccessRun                                  *string
	SucceededAt                                 *time.Time
}

type Repository

type Repository struct{}

func New

func New() *Repository

func (*Repository) ActiveEpisodes

func (*Repository) ActiveEpisodes(ctx context.Context, tx postgres.DBTX, e Expectation) ([]Episode, error)

func (*Repository) CreateEpisode

func (*Repository) CreateEpisode(ctx context.Context, tx postgres.DBTX, e Expectation, record slug.Slug, deadline, now time.Time) error

func (*Repository) CreateExpectation

func (*Repository) CreateExpectation(ctx context.Context, tx postgres.DBTX, e Expectation) (*Expectation, error)

func (*Repository) FindCurrent

func (*Repository) FindCurrent(ctx context.Context, tx postgres.DBTX, scope Scope) (Expectation, error)

func (*Repository) FindLatest

func (*Repository) FindLatest(ctx context.Context, tx postgres.DBTX, scope Scope) (*Expectation, error)

func (*Repository) Inspect

func (*Repository) Inspect(ctx context.Context, db postgres.DBTX, scope Scope) (Expectation, error)

func (*Repository) InspectEpisodes

func (*Repository) InspectEpisodes(ctx context.Context, db postgres.DBTX, scope Scope) ([]EpisodeEvidence, error)

func (*Repository) ListForSystem

func (*Repository) ListForSystem(ctx context.Context, tx postgres.DBTX) ([]Expectation, error)

func (*Repository) LockScope

func (*Repository) LockScope(ctx context.Context, tx postgres.DBTX, scope Scope) error

func (*Repository) RecordSuccess

func (*Repository) RecordSuccess(ctx context.Context, tx postgres.DBTX, org, project, environment, run slug.Slug) error

func (*Repository) ResolveEpisode

func (*Repository) ResolveEpisode(ctx context.Context, tx postgres.DBTX, e Expectation, episode Episode, reason string, now time.Time) error

type Scope

type Scope struct {
	Org, Project, Environment, Pipeline slug.Slug
}

Jump to

Keyboard shortcuts

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