Documentation
¶
Index ¶
- func MaterializedTableFields(spatial bool) map[string]map[string]string
- type FeedVersionChanges
- type Manager
- func (m *Manager) ActivateFeedVersion(ctx context.Context, feedVersionID int) error
- func (m *Manager) CalculateSetActiveChanges(ctx context.Context, feedVersionIDs []int) (FeedVersionChanges, error)
- func (m *Manager) DeactivateFeedVersion(ctx context.Context, feedVersionID int) error
- func (m *Manager) DematerializeFeedVersion(ctx context.Context, feedVersionID int) error
- func (m *Manager) GetActiveFeedVersions(ctx context.Context) ([]int, error)
- func (m *Manager) GetFeedIDForFeedVersion(ctx context.Context, fvid int) (int, error)
- func (m *Manager) GetMaterializedFeedVersionPointers(ctx context.Context) ([]int, error)
- func (m *Manager) GetMaterializedFeedVersions(ctx context.Context) ([]int, error)
- func (m *Manager) MaterializeFeedVersion(ctx context.Context, feedVersionID int) error
- func (m *Manager) SetActiveFeedVersions(ctx context.Context, feedVersionIDs []int) error
- func (m *Manager) SetExcludeFromGlobal(ctx context.Context, feedID int, exclude bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaterializedTableFields ¶ added in v1.4.0
MaterializedTableFields returns, for each materialized active table, the destination-column -> source-expression projection used by MaterializeFeedVersion. These maps are the single source of truth for what those tables must contain; schema-drift checks assert that every destination column exists in the corresponding table.
Types ¶
type FeedVersionChanges ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles feed state and materialized table operations
ActivateFeedVersion and DeactivateFeedVersion are self-transactional, joining the caller's transaction if one is open, and SetActiveFeedVersions transacts per feed version through them. Other methods leave transactions to the caller.
func NewManager ¶
NewManager creates a new feed state manager
func (*Manager) ActivateFeedVersion ¶
ActivateFeedVersion activates a feed version by setting it in feed_states and adding to materialized tables If another version of the same feed is currently active, it will be deactivated first
Runs in a transaction: the feed_states swap and materialized table rebuild must not be observed half done.
func (*Manager) CalculateSetActiveChanges ¶
func (*Manager) DeactivateFeedVersion ¶
DeactivateFeedVersion deactivates a feed version by removing it from feed_states and materialized tables If the feed version is not currently active, does nothing
func (*Manager) DematerializeFeedVersion ¶
DematerializeFeedVersion removes all routes/stops/agencies for a feed from materialized tables
func (*Manager) GetActiveFeedVersions ¶
GetActiveFeedVersions returns the active_feed_version_id of every feed that has one.
func (*Manager) GetFeedIDForFeedVersion ¶
GetFeedIDForFeedVersion gets the feed_id for a given feed_version_id (public version)
func (*Manager) GetMaterializedFeedVersionPointers ¶ added in v1.4.0
GetMaterializedFeedVersionPointers returns the materialized_feed_version_id of every feed that has one — the set that should be present in the materialized tables.
func (*Manager) GetMaterializedFeedVersions ¶
func (*Manager) MaterializeFeedVersion ¶
MaterializeFeedVersion inserts routes/stops/agencies for a feed version into materialized tables
func (*Manager) SetActiveFeedVersions ¶
SetActiveFeedVersions activates the specified feed versions and deactivates all others This replaces the entire set of active feed versions with the provided list
func (*Manager) SetExcludeFromGlobal ¶ added in v1.4.0
SetExcludeFromGlobal sets a feed's global-query visibility and reconciles its materialized pointer and materialized tables: excluding dematerializes the active version, including materializes it. Runs in a transaction.