deploymentpg

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package deploymentpg stores the sandbox deployment, its retained generations and its nodes in PostgreSQL. It seals the deployment's provider credential with the Core credential key, bound to the installation and generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Execution

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

Execution is the deployment storage of the execution owner: every transaction runs on the connection that holds the execution lease.

func NewExecution

func NewExecution(lease *pgunit.Lease, cipher *credentialcrypto.Cipher) *Execution

NewExecution binds deployment changes to the execution lease.

func (*Execution) ClearWake

func (e *Execution) ClearWake(ctx context.Context, allocationID string, observed time.Time) error

func (*Execution) WithAllocation

func (e *Execution) WithAllocation(ctx context.Context, key deployment.AllocationKey, apply func(deployment.AllocationTx) error) error

func (*Execution) WithAllocationCleanup

func (e *Execution) WithAllocationCleanup(ctx context.Context, key deployment.AllocationKey, apply func(deployment.AllocationCleanupTx) error) error

func (*Execution) WithDeployment

func (e *Execution) WithDeployment(ctx context.Context, apply func(deployment.DeploymentTx) error) error

func (*Execution) WithReservation

func (*Execution) WithSessionArchive added in v0.0.10

func (e *Execution) WithSessionArchive(ctx context.Context, tenantID, sessionID string, apply func(context.Context, sessions.LockedSession, deployment.SessionArchiveTx) error) error

type Store

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

Store is the deployment storage and reader on pooled connections. It grants no execution authority.

func New

func New(pool *pgunit.Pool, cipher *credentialcrypto.Cipher) *Store

New returns the deployment store, which seals the provider credential with cipher.

func (*Store) Activity

func (s *Store) Activity(ctx context.Context, allocationID string) (deployment.Activity, error)

func (*Store) AddressBindings

func (s *Store) AddressBindings(ctx context.Context, publicURL string) (deployment.AddressBindings, error)

func (*Store) Allocation

func (*Store) ConnectNode

func (s *Store) ConnectNode(ctx context.Context, nodeID, connectionID string, epoch uint64) (bool, error)

func (*Store) CredentialAllocations

func (s *Store) CredentialAllocations(ctx context.Context, after string) ([]deployment.Allocation, error)

func (*Store) Deployment

func (s *Store) Deployment(ctx context.Context) (deployment.Record, error)

Deployment bounds its read by the execution deadline: the execution owner reads the setup through it before provider work.

func (*Store) DisconnectNode

func (s *Store) DisconnectNode(ctx context.Context, nodeID, connectionID string, epoch uint64) error

func (*Store) EnvironmentAllocation

func (s *Store) EnvironmentAllocation(ctx context.Context, key deployment.AllocationKey) (deployment.Allocation, error)

func (*Store) Generations

func (s *Store) Generations(ctx context.Context, after int64) ([]deployment.GenerationRecord, error)

func (*Store) LifecycleAllocations

func (s *Store) LifecycleAllocations(ctx context.Context, nodeID, after string) ([]deployment.Allocation, error)

func (*Store) LifecycleNodes

func (s *Store) LifecycleNodes(ctx context.Context) ([]string, error)

func (*Store) LifecyclePlacement

func (s *Store) LifecyclePlacement(ctx context.Context, key deployment.AllocationKey) (deployment.LifecyclePlacement, error)

func (*Store) NodeAllocations

func (s *Store) NodeAllocations(ctx context.Context, nodeID string) ([]deployment.NodeAllocation, error)

func (*Store) NodeHistory

func (*Store) NodeOnline

func (s *Store) NodeOnline(ctx context.Context, nodeID string) (bool, error)

func (*Store) Nodes

func (s *Store) Nodes(ctx context.Context) ([]deployment.NodeRecord, error)

func (*Store) ObservationSessions

func (s *Store) ObservationSessions(ctx context.Context, after string, limit int) (deployment.ObservationSessionPage, error)

func (*Store) OwnerEpoch

func (s *Store) OwnerEpoch(ctx context.Context) (uint64, error)

func (*Store) PlacementDemand added in v0.0.10

func (*Store) ReadNodes

func (s *Store) ReadNodes(ctx context.Context, apply func(deployment.NodeReads) error) error

func (*Store) ResetSessions

func (s *Store) ResetSessions(ctx context.Context, after string, force bool) ([]deployment.ResetSession, error)

func (*Store) RetainedNativeHistory added in v0.0.10

func (s *Store) RetainedNativeHistory(ctx context.Context, key deployment.AllocationKey) (bool, error)

func (*Store) SampleHostHistory

func (s *Store) SampleHostHistory(ctx context.Context) (int64, error)

func (*Store) Snapshot

func (s *Store) Snapshot(ctx context.Context) (deployment.Snapshot, error)

func (*Store) UnallocatedEnvironments

func (s *Store) UnallocatedEnvironments(ctx context.Context, nodeID, after string) ([]deployment.UnallocatedEnvironment, error)

func (*Store) WithActivity

func (*Store) WithNodes

func (s *Store) WithNodes(ctx context.Context, apply func(deployment.NodeTx) error) error

Jump to

Keyboard shortcuts

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