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 ¶
- type Store
- func (s *Store) Create(ctx context.Context, a automations.Automation) (automations.Automation, error)
- func (s *Store) Delete(ctx context.Context, tenantID, id string) (string, error)
- func (s *Store) Deliverable(ctx context.Context, limit int) ([]automations.Delivery, error)
- func (s *Store) Get(ctx context.Context, tenantID, id string) (automations.Automation, error)
- func (s *Store) GetInvocation(ctx context.Context, tenantID, id, invocationID string) (automations.Invocation, error)
- func (s *Store) Invoke(ctx context.Context, tenantID, id string) (automations.Invocation, error)
- func (s *Store) List(ctx context.Context, tenantID string, query automations.ListQuery) (automations.Page, error)
- func (s *Store) ListInvocations(ctx context.Context, tenantID, id string, query automations.ListQuery) (automations.InvocationPage, error)
- func (s *Store) Record(ctx context.Context, now time.Time) (int, error)
- func (s *Store) Settle(ctx context.Context, outcome automations.Outcome) error
- func (s *Store) Update(ctx context.Context, tenantID, id string, ...) (automations.Automation, error)
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 (*Store) Create ¶
func (s *Store) Create(ctx context.Context, a automations.Automation) (automations.Automation, error)
func (*Store) Deliverable ¶
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 ¶
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) Update ¶
func (s *Store) Update(ctx context.Context, tenantID, id string, change func(automations.Automation) (automations.Automation, error)) (automations.Automation, error)