repositorysetups

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: 9 Imported by: 0

Documentation

Overview

Package repositorysetups persists resumable project repository setup state.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound  = xerror.NotFound(xerror.Project).Detail("project repository setup was not found")
	ErrBusy      = xerror.New(xerror.KindAlreadyExists, "PROJECT_REPOSITORY_SETUP_BUSY", "project repository setup is leased")
	ErrLeaseLost = xerror.New(xerror.KindAlreadyExists, "PROJECT_REPOSITORY_SETUP_LEASE_LOST", "project repository setup lease was lost")
)

Functions

This section is empty.

Types

type Repository

type Repository struct{}

func New

func New() *Repository

func (*Repository) Abandon

func (*Repository) Abandon(ctx context.Context, db postgres.DBTX, org, project, setup slug.Slug, leaseOwner string) (*Row, error)

func (*Repository) Claim

func (*Repository) Claim(ctx context.Context, db postgres.DBTX, org, project, setup slug.Slug, leaseOwner string) (*Row, error)

func (*Repository) Create

func (*Repository) Create(ctx context.Context, db postgres.DBTX, org, project, setupSlug slug.Slug, request json.RawMessage) (bool, error)

func (*Repository) Get

func (*Repository) Get(ctx context.Context, db postgres.DBTX, org, project slug.Slug) (*Row, error)

func (*Repository) GetAttempt

func (*Repository) GetAttempt(ctx context.Context, db postgres.DBTX, org, project, setup slug.Slug) (*Row, error)

func (*Repository) ProjectForSetup

func (*Repository) ProjectForSetup(ctx context.Context, db postgres.DBTX, org, setup slug.Slug) (slug.Slug, error)

func (*Repository) Release

func (*Repository) Release(ctx context.Context, db postgres.DBTX, org, project slug.Slug, leaseOwner string) error

func (*Repository) Update

func (*Repository) Update(ctx context.Context, db postgres.DBTX, org, project slug.Slug, leaseOwner string, row *Row) error

type Row

type Row struct {
	Slug        slug.Slug
	Request     json.RawMessage
	Result      json.RawMessage
	Status      string
	FailureCode string
	AbandonedAt *time.Time
}

Jump to

Keyboard shortcuts

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