automationpg

package
v0.0.14-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 16 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 automationpg stores Automations and their invocations in PostgreSQL. The target request, which may hold confidential Session configuration, is sealed with the credential key and bound to its tenant and Automation. A queued invocation carries its own sealed copy until it settles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store implements automations.Storage and automations.Reader.

func New

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

func (*Store) Create

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, tenantID, id string) (string, error)

func (*Store) Deliverable

func (s *Store) Deliverable(ctx context.Context, limit int) ([]automations.Delivery, error)

func (*Store) Get

func (s *Store) Get(ctx context.Context, tenantID, id string) (automations.Automation, error)

func (*Store) GetInvocation

func (s *Store) GetInvocation(ctx context.Context, tenantID, id, invocationID string) (automations.Invocation, error)

func (*Store) Invoke

func (s *Store) Invoke(ctx context.Context, tenantID, id string) (automations.Invocation, error)

func (*Store) List

func (s *Store) List(ctx context.Context, tenantID string, query automations.ListQuery) (automations.Page, error)

List reads the cursor and the page in one snapshot.

func (*Store) ListInvocations

func (s *Store) ListInvocations(ctx context.Context, tenantID, id string, query automations.ListQuery) (automations.InvocationPage, error)

ListInvocations reads the Automation, the cursor and the page in one snapshot, so a missing Automation answers before an unresolved cursor.

func (*Store) Record

func (s *Store) Record(ctx context.Context, now time.Time) (int, error)

Record records the occurrence of each due active Automation of a live Project and advances it, each in its own transaction so that one failing Automation stops no other. The unique scheduled time keeps an occurrence single across concurrent passes.

func (*Store) Settle

func (s *Store) Settle(ctx context.Context, outcome automations.Outcome) error

func (*Store) Update

func (s *Store) Update(ctx context.Context, tenantID, id string, change func(automations.Automation) (automations.Automation, error)) (automations.Automation, error)

Jump to

Keyboard shortcuts

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