postgres

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithClock

func WithClock(clock commoncore.Clock) func(*StateContainer)

WithClock sets the clock to use for the state container. This is used in tasks like determining the current time when checking for recently queued events.

When not set, the default value is the system clock.

func WithRecentlyQueuedEventsThreshold

func WithRecentlyQueuedEventsThreshold(thresholdSeconds int64) func(*StateContainer)

WithRecentlyQueuedEventsThreshold sets the threshold in seconds for retrieving recently queued events for a stream when a starting event ID is not provided.

When not set, the default value is 5 minutes (300 seconds).

Types

type Option

type Option func(*StateContainer)

Option is a type for options that can be passed to LoadStateContainer when creating a postgres state container.

type StateContainer

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

StateContainer provides the postgres implementation of the blueprint `state.Container` interface along with methods to manage persistence for blueprint validation requests, events and change sets.

func LoadStateContainer

func LoadStateContainer(
	ctx context.Context,
	connPool *pgxpool.Pool,
	logger core.Logger,
	opts ...Option,
) (*StateContainer, error)

LoadStateContainer loads a new state container that uses postgres for persistence.

The postgres connection pool must be configured appropriately in the calling application where the application will take care of making sure the connection pool is cleaned up when a command is finished or the application is shutting down.

func (*StateContainer) Changesets

func (c *StateContainer) Changesets() manage.Changesets

func (*StateContainer) Children

func (c *StateContainer) Children() state.ChildrenContainer

func (*StateContainer) Events

func (c *StateContainer) Events() manage.Events

func (*StateContainer) Exports

func (c *StateContainer) Exports() state.ExportsContainer

func (*StateContainer) Instances

func (c *StateContainer) Instances() state.InstancesContainer
func (c *StateContainer) Links() state.LinksContainer

func (*StateContainer) Metadata

func (c *StateContainer) Metadata() state.MetadataContainer

func (*StateContainer) Resources

func (c *StateContainer) Resources() state.ResourcesContainer

func (*StateContainer) Validation

func (c *StateContainer) Validation() manage.Validation

Jump to

Keyboard shortcuts

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