Documentation
¶
Index ¶
- func WithClock(clock commoncore.Clock) func(*StateContainer)
- func WithRecentlyQueuedEventsThreshold(thresholdSeconds int64) func(*StateContainer)
- type Option
- type StateContainer
- func (c *StateContainer) Changesets() manage.Changesets
- func (c *StateContainer) Children() state.ChildrenContainer
- func (c *StateContainer) Events() manage.Events
- func (c *StateContainer) Exports() state.ExportsContainer
- func (c *StateContainer) Instances() state.InstancesContainer
- func (c *StateContainer) Links() state.LinksContainer
- func (c *StateContainer) Metadata() state.MetadataContainer
- func (c *StateContainer) Resources() state.ResourcesContainer
- func (c *StateContainer) Validation() manage.Validation
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 (*StateContainer) Links ¶
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
Source Files
¶
- blueprint_validation_queries.go
- changeset_queries.go
- common_actions.go
- common_queries.go
- container.go
- container_changesets.go
- container_children.go
- container_events.go
- container_exports.go
- container_instances.go
- container_links.go
- container_metadata.go
- container_resources.go
- container_validation.go
- event_queries.go
- instance_queries.go
- link_queries.go
- resource_queries.go
- types.go
- utils.go