Documentation
¶
Overview ¶
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func ActivateSubscription(c *fiber.Ctx) error
- func CancelRun(c *fiber.Ctx) error
- func CreateFiberApp(myLibrary *library.Library, registry *RunRegistry, logCapture *LogCapture, ...) *fiber.App
- func CreatePublication(c *fiber.Ctx) error
- func CreateSubscription(c *fiber.Ctx) error
- func DeactivateSubscription(c *fiber.Ctx) error
- func DeletePublication(c *fiber.Ctx) error
- func DeleteSubscription(c *fiber.Ctx) error
- func DownloadRunLog(c *fiber.Ctx) error
- func ExecuteSQL(c *fiber.Ctx) error
- func ExportSQL(c *fiber.Ctx) error
- func GetAvailablePublicationTypes(c *fiber.Ctx) error
- func GetProviders(c *fiber.Ctx) error
- func GetPublicConfig(c *fiber.Ctx) error
- func GetPublication(c *fiber.Ctx) error
- func GetPublicationCandidates(c *fiber.Ctx) error
- func GetPublications(c *fiber.Ctx) error
- func GetQualityIssues(c *fiber.Ctx) error
- func GetQualitySummary(c *fiber.Ctx) error
- func GetRunHistory(c *fiber.Ctx) error
- func GetRunLog(c *fiber.Ctx) error
- func GetRunSparkline(c *fiber.Ctx) error
- func GetSubscription(c *fiber.Ctx) error
- func GetSubscriptionData(c *fiber.Ctx) error
- func GetSubscriptions(c *fiber.Ctx) error
- func NewAuthMiddleware() fiber.Handler
- func QualityCheckEvents(c *fiber.Ctx) error
- func RunEvents(c *fiber.Ctx) error
- func RunStatus(c *fiber.Ctx) error
- func RunSubscription(ctx context.Context, lib *library.Library, sub *library.Subscription, ...)
- func SetupRoutes(app *fiber.App)
- func SetupSPA(app *fiber.App)
- func TriggerQualityCheck(c *fiber.Ctx) error
- func TriggerRun(c *fiber.Ctx) error
- func UpdatePublication(c *fiber.Ctx) error
- func UpdateSubscription(c *fiber.Ctx) error
- type AvailableType
- type CandidateSource
- type CreatePublicationRequest
- type CreateSubscriptionRequest
- type EnrichedPublishedView
- type EnrichedSource
- type HttpError
- type LogCapture
- type ProgressThrottle
- type ProviderResponse
- type PublicConfig
- type PublishedViewSummary
- type QualityIssue
- type QualityIssuesResponse
- type QualitySummaryRow
- type RunOptions
- type RunRegistry
- func (r *RunRegistry) Delete(subscriptionID string)
- func (r *RunRegistry) DeleteIf(subscriptionID string, run *activeRun)
- func (r *RunRegistry) IsActive(subscriptionID string) bool
- func (r *RunRegistry) Load(subscriptionID string) (*activeRun, bool)
- func (r *RunRegistry) TryReserve(subscriptionID string) (*activeRun, bool)
- type RunSource
- type SQLRequest
- type Scheduler
- type SubscriptionRunner
- type UpdatePublicationRequest
- type UpdateSubscriptionRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActivateSubscription ¶
ActivateSubscription activates a subscription by ID.
func CancelRun ¶ added in v0.5.3
CancelRun aborts an in-progress run. With ?force=true the run_history row is marked cancelled and the registry slot is freed immediately; the already-running goroutine continues until it observes ctx.Done() (or completes its in-flight HTTP/sleep) and is detached from the registry so a new run can be triggered. Without force the context is cancelled and the goroutine is allowed to finalise the row itself on the way out.
Returns 200 with `{status:"cancelled"|"cancelling"}` on success, 404 when no run is active for the subscription.
func CreateFiberApp ¶
func CreateFiberApp(myLibrary *library.Library, registry *RunRegistry, logCapture *LogCapture, scheduler *Scheduler) *fiber.App
func CreatePublication ¶
CreatePublication creates a new empty published view for a data type.
func CreateSubscription ¶
CreateSubscription creates a new subscription from JSON body.
func DeactivateSubscription ¶
DeactivateSubscription deactivates a subscription by ID.
func DeletePublication ¶
DeletePublication deletes a published view and its database view.
func DeleteSubscription ¶
DeleteSubscription deletes a subscription by ID.
func DownloadRunLog ¶ added in v0.5.3
DownloadRunLog returns the captured log text for a run as an attachment. The body is raw newline-delimited JSON (the underlying zerolog format). Returns 404 when the subscription is unknown, 204 when no log was captured or it has been swept by the 30-day retention.
func ExecuteSQL ¶
ExecuteSQL runs a user-provided SQL query in a read-only transaction.
func GetAvailablePublicationTypes ¶
GetAvailablePublicationTypes returns data types that can have new published views.
func GetProviders ¶
GetProviders returns a map of all registered providers keyed by provider key.
func GetPublicConfig ¶ added in v0.4.0
GetPublicConfig returns the runtime config payload consumed by the SPA.
func GetPublication ¶
GetPublication returns a single published view with enriched source metadata.
func GetPublicationCandidates ¶
GetPublicationCandidates returns subscription tables eligible as sources.
func GetPublications ¶
GetPublications returns all published views as summaries.
func GetQualityIssues ¶
GetQualityIssues returns paginated data quality issues with optional filters.
func GetQualitySummary ¶
GetQualitySummary returns counts of issues grouped by check_name, severity, and data_type.
func GetRunHistory ¶
GetRunHistory returns paginated run history for a subscription.
func GetRunLog ¶ added in v0.4.3
GetRunLog returns a paged slice of the captured log text for a specific run_history row. The response shape is:
{
"lines": ["..."], // chronological order
"total": <int>, // total line count across the full log
"start_line": <int>, // 1-indexed lineno of lines[0] (0 when empty)
"limit": <int> // applied page size
}
Query parameters:
- limit -- page size (default 1000, capped at 5000)
- before -- upper-bound line cursor (exclusive) for "load earlier" paging. Omit or set to 0 to fetch the tail (newest lines).
`lines` is empty when no log was ever captured or the 30-day retention has cleared it. To download the full log unpaged, use the /log/download endpoint.
func GetRunSparkline ¶
GetRunSparkline returns daily aggregated observation counts for sparkline display.
func GetSubscription ¶
GetSubscription returns a single subscription by ID prefix.
func GetSubscriptionData ¶
GetSubscriptionData queries dynamic data from a subscription's data table.
func GetSubscriptions ¶
GetSubscriptions returns all subscriptions.
func NewAuthMiddleware ¶
NewAuthMiddleware returns a Fiber handler that validates RS256 JWTs against the configured OIDC issuer. Works with any provider (Auth0, Zitadel, etc.) that publishes a JWKS and issues RS256-signed tokens.
Required config keys:
auth.issuer — full issuer URL exactly as it appears in the token's iss claim auth.jwks_url — full JWKS URL auth.audience — expected audience claim
When auth.issuer is empty, it returns a pass-through middleware for dev mode.
func QualityCheckEvents ¶
QualityCheckEvents streams SSE for an active quality check.
func RunStatus ¶ added in v0.4.3
RunStatus reports whether a run is currently active for a subscription. Used by the UI to auto-attach SSE on page load if a run started elsewhere (e.g. by the scheduler).
func RunSubscription ¶ added in v0.4.3
func RunSubscription(ctx context.Context, lib *library.Library, sub *library.Subscription, opts RunOptions)
RunSubscription executes a fetch for the subscription, persists observations, saves run history, runs post-fetch hooks, publishes SSE events (if a run is attached), and pings healthchecks at start and finish.
The caller must reserve a registry slot via TryReserve and pass the resulting activeRun in opts.Run. RunSubscription owns the run lifecycle thereafter and will call run.finish() before returning.
func SetupRoutes ¶
func SetupSPA ¶
SetupSPA configures the Fiber app to serve the embedded Vue SPA. Static files are served from the embedded ui/dist directory. Non-matching routes fall back to index.html for SPA history-mode routing via the filesystem middleware's NotFoundFile option.
func TriggerQualityCheck ¶
TriggerQualityCheck starts a data quality audit in the background.
func TriggerRun ¶
TriggerRun starts an on-demand run for a subscription. Accepts optional query param: ?lookback=30d (e.g. "7d", "30d", "365d"). Default: 14d.
func UpdatePublication ¶
UpdatePublication updates the sources of a published view.
func UpdateSubscription ¶
UpdateSubscription updates fields on an existing subscription.
Types ¶
type AvailableType ¶
type AvailableType struct {
DataTypeKey string `json:"data_type_key"`
ViewName string `json:"view_name"`
}
AvailableType is a data type that can have a new published view created.
type CandidateSource ¶
type CandidateSource struct {
TableName string `json:"table_name"`
SubscriptionID string `json:"subscription_id"`
SubscriptionName string `json:"subscription_name"`
Provider string `json:"provider"`
Dataset string `json:"dataset"`
}
CandidateSource is a subscription table eligible to be added as a source.
type CreatePublicationRequest ¶
type CreatePublicationRequest struct {
DataTypeKey string `json:"data_type_key"`
}
CreatePublicationRequest is the JSON body for creating a new published view.
type CreateSubscriptionRequest ¶
type CreateSubscriptionRequest struct {
Provider string `json:"provider"`
Dataset string `json:"dataset"`
Config map[string]string `json:"config"`
Schedule string `json:"schedule"`
DataTypes []string `json:"data_types"`
HealthCheckID string `json:"health_check_id"`
CreateHealthcheck bool `json:"create_healthcheck"`
}
CreateSubscriptionRequest is the JSON body for creating a new subscription.
type EnrichedPublishedView ¶
type EnrichedPublishedView struct {
ID uuid.UUID `json:"id"`
ViewName string `json:"view_name"`
DataTypeKey string `json:"data_type_key"`
Sources []EnrichedSource `json:"sources"`
Overlaps []string `json:"overlaps,omitempty"`
}
EnrichedPublishedView is a PublishedView with enriched sources and overlap warnings.
type EnrichedSource ¶
type EnrichedSource struct {
TableName string `json:"table_name"`
SubscriptionID string `json:"subscription_id"`
FromDate *string `json:"from_date"`
UntilDate *string `json:"until_date"`
SubscriptionName string `json:"subscription_name"`
Provider string `json:"provider"`
Dataset string `json:"dataset"`
}
EnrichedSource is a ViewSource augmented with subscription metadata for the UI.
type LogCapture ¶ added in v0.4.3
type LogCapture struct {
// contains filtered or unexported fields
}
LogCapture is an io.Writer that intercepts zerolog's JSON output, picks out events tagged with a SubscriptionID matching an active run, and:
- publishes a "log" SSE event to the run's event channel so connected clients see logs streaming in real time,
- appends the line to a per-run buffer that the run pipeline drains and persists alongside the run history record.
The writer also forwards every line untouched to a passthrough writer (typically the existing zerolog ConsoleWriter) so dev/console output is unchanged.
The per-run buffer is intentionally unbounded: the captured log is preserved in full for diagnostic value, with retention enforced at the database layer via SweepRunLogs (30 days by default).
func NewLogCapture ¶ added in v0.4.3
func NewLogCapture(registry *RunRegistry) *LogCapture
NewLogCapture creates a capture sink bound to the given registry.
func (*LogCapture) Drain ¶ added in v0.4.3
func (lc *LogCapture) Drain(subID string) string
Drain returns the captured log buffer for the subscription and clears it. Call once when a run completes.
func (*LogCapture) Snapshot ¶ added in v0.5.2
func (lc *LogCapture) Snapshot(subID string) string
Snapshot returns a copy of the captured log buffer for the subscription without clearing it. Use this for periodic in-flight flushes to the run_history.log column so partial logs survive an abrupt process exit; pair it with a final Drain at run-end.
type ProgressThrottle ¶ added in v0.5.0
type ProgressThrottle struct {
// contains filtered or unexported fields
}
ProgressThrottle invokes emit at most once per interval. The first Tick fires immediately; later Ticks within the interval are dropped but the most recent count is remembered so Flush can emit it later. Not safe for concurrent Ticks.
func NewProgressThrottle ¶ added in v0.5.0
func NewProgressThrottle(interval time.Duration, emit func(int)) *ProgressThrottle
NewProgressThrottle returns a throttle that calls emit at most once per interval.
func (*ProgressThrottle) Flush ¶ added in v0.5.0
func (p *ProgressThrottle) Flush()
Flush emits the most recent pending count even if the interval has not elapsed. Safe to call when nothing is pending; in that case it is a no-op.
type ProviderResponse ¶
type ProviderResponse struct {
Name string `json:"name"`
Description string `json:"description"`
ConfigDescription map[string]string `json:"config_description"`
Datasets map[string]providerDatasetResponse `json:"datasets"`
}
ProviderResponse describes a single provider and its datasets.
type PublicConfig ¶ added in v0.4.0
type PublicConfig struct {
AuthIssuer string `json:"auth_issuer"`
AuthClientID string `json:"auth_client_id"`
AuthAudience string `json:"auth_audience"`
Version string `json:"version"`
Commit string `json:"commit"`
BuildDate string `json:"build_date"`
}
PublicConfig is the runtime config the embedded SPA fetches at boot to wire its OIDC client. Only values safe to expose to a browser belong here — never secrets.
type PublishedViewSummary ¶
type PublishedViewSummary struct {
ID uuid.UUID `json:"id"`
ViewName string `json:"view_name"`
DataTypeKey string `json:"data_type_key"`
SourceCount int `json:"source_count"`
}
PublishedViewSummary is the list response item.
type QualityIssue ¶
type QualityIssue struct {
ID uuid.UUID `json:"id"`
CheckName string `json:"check_name"`
Severity string `json:"severity"`
DataType string `json:"data_type"`
Ticker *string `json:"ticker"`
CompositeFIGI *string `json:"composite_figi"`
Dimension *string `json:"dimension"`
EventDate *time.Time `json:"event_date"`
Field *string `json:"field"`
Message string `json:"message"`
Expected *string `json:"expected"`
Actual *string `json:"actual"`
SubscriptionID *uuid.UUID `json:"subscription_id"`
RunID *uuid.UUID `json:"run_id"`
DetectedAt time.Time `json:"detected_at"`
}
QualityIssue represents a single row from data_quality_issues.
type QualityIssuesResponse ¶
type QualityIssuesResponse struct {
Issues []QualityIssue `json:"issues"`
Total int `json:"total"`
Limit int `json:"limit"`
Offset int `json:"offset"`
}
QualityIssuesResponse is the paginated response for GetQualityIssues.
type QualitySummaryRow ¶
type QualitySummaryRow struct {
CheckName string `json:"check_name"`
Severity string `json:"severity"`
DataType string `json:"data_type"`
Count int `json:"count"`
}
QualitySummaryRow represents a single group in the summary query.
type RunOptions ¶ added in v0.4.3
type RunOptions struct {
// Run is the registry-managed activeRun. Required when callers want SSE
// streaming or auto-attach support; pre-reserve via registry.TryReserve.
Run *activeRun
// Lookback overrides the default fetch window when non-zero.
Lookback time.Duration
// Source labels the run for logs / healthcheck bodies.
Source RunSource
// LogCapture, when set, drains the per-run log buffer so it can be
// persisted alongside run history. Set by the serve command at startup.
LogCapture *LogCapture
}
RunOptions configures a subscription run.
type RunRegistry ¶
type RunRegistry struct {
// contains filtered or unexported fields
}
RunRegistry manages active subscription runs (scheduled and on-demand), keyed by subscription ID string.
func (*RunRegistry) Delete ¶
func (r *RunRegistry) Delete(subscriptionID string)
Delete removes an active run entry unconditionally.
func (*RunRegistry) DeleteIf ¶ added in v0.5.3
func (r *RunRegistry) DeleteIf(subscriptionID string, run *activeRun)
DeleteIf removes the entry only if the current value matches run. Used by finish() so a force-cancel that already replaced or freed the slot is not double-released by the eventually-exiting goroutine.
func (*RunRegistry) IsActive ¶ added in v0.4.3
func (r *RunRegistry) IsActive(subscriptionID string) bool
IsActive reports whether a run is currently in progress for the subscription.
func (*RunRegistry) Load ¶
func (r *RunRegistry) Load(subscriptionID string) (*activeRun, bool)
Load retrieves an active run by subscription ID.
func (*RunRegistry) TryReserve ¶ added in v0.4.3
func (r *RunRegistry) TryReserve(subscriptionID string) (*activeRun, bool)
TryReserve atomically claims a slot for a subscription run. Returns the activeRun and true on success, or (nil, false) if a run is already in progress for the subscription.
type RunSource ¶ added in v0.4.3
type RunSource string
RunSource labels the trigger origin of a subscription run for logs and healthcheck ping bodies.
type SQLRequest ¶
type SQLRequest struct {
Query string `json:"query"`
}
SQLRequest is the JSON body for SQL execution endpoints.
type Scheduler ¶ added in v0.5.0
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler wraps a gocron.Scheduler with per-subscription job tracking so the web handlers can add, remove, and replace jobs as subscriptions are created, edited, activated, or deactivated.
func NewScheduler ¶ added in v0.5.0
func NewScheduler(inner gocron.Scheduler, runner SubscriptionRunner) *Scheduler
NewScheduler wraps the given gocron.Scheduler. The runner is called on every cron fire with the subscription id.
type SubscriptionRunner ¶ added in v0.5.0
SubscriptionRunner is invoked by Scheduler when a subscription's cron fires. It receives only the subscription id so the runner can load the current subscription state from the library, ensuring edits made after scheduling (config, schedule, etc.) are reflected on the next run.
type UpdatePublicationRequest ¶
type UpdatePublicationRequest struct {
Sources []library.ViewSource `json:"sources"`
}
UpdatePublicationRequest is the JSON body for updating published view sources.
type UpdateSubscriptionRequest ¶
type UpdateSubscriptionRequest struct {
Name *string `json:"name"`
Schedule *string `json:"schedule"`
Config *map[string]string `json:"config"`
HealthCheckID *string `json:"health_check_id"`
Active *bool `json:"active"`
}
UpdateSubscriptionRequest is the JSON body for updating an existing subscription.
Source Files
¶
- auth.go
- embed.go
- fiber.go
- handlers.go
- handlers_config.go
- handlers_data.go
- handlers_providers.go
- handlers_publications.go
- handlers_quality.go
- handlers_quality_run.go
- handlers_run_now.go
- handlers_runs.go
- handlers_sql.go
- log_capture.go
- observation_summary.go
- progress_throttle.go
- route.go
- run.go
- run_registry.go
- scheduler.go