Documentation
¶
Overview ¶
Package datamodule is the kitchen sink's synthetic dataset provider and managed target. It owns only data_example_* tables in a dedicated SQLite file. The generic lifecycle service owns operations, receipts and generations.
Index ¶
- Constants
- func Hash(value string) string
- func RenderOrdersReport(report OrdersReport) ([]byte, error)
- type OrdersReport
- type Record
- type Runtime
- func (r *Runtime) ActiveOrdersReport(ctx context.Context, target data.TargetKey) (OrdersReport, error)
- func (r *Runtime) ActiveRecords(ctx context.Context, target data.TargetKey) ([]Record, error)
- func (r *Runtime) Allocate(ctx context.Context, work data.Work) error
- func (*Runtime) AuthorizeExplore(ctx context.Context, p data.Principal, a data.ExploreAccess) error
- func (*Runtime) Capabilities() data.TargetCapabilities
- func (r *Runtime) Catalog(_ context.Context, _ data.Principal, target data.TargetKey, limit int) ([]data.DatasetRef, error)
- func (r *Runtime) Close() error
- func (r *Runtime) Commit(ctx context.Context, work data.Work, intent data.Intent) error
- func (r *Runtime) Describe(_ context.Context, _ data.Principal, ref data.DatasetRef) (data.Descriptor, error)
- func (r *Runtime) DrainCleanup(ctx context.Context, work data.Work, stage string) error
- func (r *Runtime) EndPreview(ctx context.Context, id, state string) error
- func (r *Runtime) ExploreInsights(ctx context.Context, p data.Principal, read data.ExploreRead, ...) (data.ExploreInsights, error)
- func (r *Runtime) ExploreMetadata(ctx context.Context, p data.Principal, read data.ExploreRead) (data.ExploreMetadata, error)
- func (r *Runtime) ExploreRelated(ctx context.Context, p data.Principal, read data.ExploreRead, ...) (data.ExploreSamples, error)
- func (r *Runtime) ExploreSamples(ctx context.Context, p data.Principal, read data.ExploreRead, ...) (data.ExploreSamples, error)
- func (*Runtime) InsightAuthorizationRevision(ctx context.Context, _ data.Principal) (string, error)
- func (r *Runtime) InsightMetricSets(ctx context.Context, p data.Principal, read data.ExploreRead) ([]data.InsightMetricSet, error)
- func (r *Runtime) InspectIntent(ctx context.Context, intent data.Intent) (data.Observation, error)
- func (r *Runtime) InspectPreview(ctx context.Context, w data.PreviewRecord) error
- func (r *Runtime) InspectReceipt(ctx context.Context, receipt data.PreparationReceipt) error
- func (r *Runtime) LookupPreview(ctx context.Context, id string) (data.PreviewRecord, error)
- func (r *Runtime) OpenPreview(ctx context.Context, w data.PreviewRecord, quota int) (data.PreviewRecord, error)
- func (r *Runtime) Plan(ctx context.Context, p data.Principal, kind data.Kind, input data.Input) ([]data.Check, error)
- func (r *Runtime) Prepare(ctx context.Context, work data.Work) (data.PreparationReceipt, error)
- func (*Runtime) PreviewGuarantees() data.PreviewGuarantees
- func (r *Runtime) PreviewOrdersReport(ctx context.Context, read data.PreviewReadContext) (OrdersReport, error)
- func (r *Runtime) PreviewReadiness(ctx context.Context, p data.Principal, read data.ExploreRead) error
- func (r *Runtime) PrunePreviews(ctx context.Context, limit int) error
- func (r *Runtime) Refresh(ctx context.Context, work data.Work) (data.PreparationReceipt, error)
- func (r *Runtime) Validate(ctx context.Context, _ data.Principal, input data.Input) ([]data.Check, error)
- func (r *Runtime) Verify(ctx context.Context, work data.Work, receipt data.PreparationReceipt) (data.VerificationResult, error)
- type RuntimeOptions
Constants ¶
const OrdersReportSurface = "synthetic-orders-report"
const TargetID = "kitchen-sink"
Variables ¶
This section is empty.
Functions ¶
func RenderOrdersReport ¶
func RenderOrdersReport(report OrdersReport) ([]byte, error)
RenderOrdersReport renders the report view fragment. Values are escaped by html/template; the fragment carries no document, script, form or link.
Types ¶
type OrdersReport ¶
type OrdersReport struct {
Orders []Record `json:"orders"`
OrderCount int `json:"order_count"`
AmountTotal int `json:"amount_total"`
Unit string `json:"unit"`
}
OrdersReport is the ordinary application report read model, shared by active and preview views. It is not an explorer sample envelope. Queries use an explicit physical stage and never a production/default connection.
type Runtime ¶
type Runtime struct {
Store *sqlitestore.Store
// contains filtered or unexported fields
}
Runtime is both the provider and target adapter. SQLite immediate transactions serialize physical effects with the management store's lease acquisition in the same database. CheckLease runs after taking that write lock, so a newer management fence cannot commit between checking authority and writing rows.
func OpenWithOptions ¶
func OpenWithOptions(filename string, options RuntimeOptions) (*Runtime, error)
func (*Runtime) ActiveOrdersReport ¶
func (*Runtime) ActiveRecords ¶
ActiveRecords is an application read of the physical route, useful to prove a scenario switch changes the query result rather than only the console label.
func (*Runtime) AuthorizeExplore ¶
func (*Runtime) Capabilities ¶
func (*Runtime) Capabilities() data.TargetCapabilities
func (*Runtime) Describe ¶
func (r *Runtime) Describe(_ context.Context, _ data.Principal, ref data.DatasetRef) (data.Descriptor, error)
func (*Runtime) DrainCleanup ¶
func (*Runtime) EndPreview ¶
func (*Runtime) ExploreInsights ¶
func (r *Runtime) ExploreInsights(ctx context.Context, p data.Principal, read data.ExploreRead, q data.ExploreInsightsQuery, budget data.InsightWork) (data.ExploreInsights, error)
func (*Runtime) ExploreMetadata ¶
func (r *Runtime) ExploreMetadata(ctx context.Context, p data.Principal, read data.ExploreRead) (data.ExploreMetadata, error)
func (*Runtime) ExploreRelated ¶
func (r *Runtime) ExploreRelated(ctx context.Context, p data.Principal, read data.ExploreRead, q data.ExploreRelatedQuery) (data.ExploreSamples, error)
func (*Runtime) ExploreSamples ¶
func (r *Runtime) ExploreSamples(ctx context.Context, p data.Principal, read data.ExploreRead, q data.ExploreSamplesQuery) (data.ExploreSamples, error)
func (*Runtime) InsightAuthorizationRevision ¶
Synthetic domain policy is immutable: all isolated fields/metrics are allowed by the fixed allowlists in AuthorizeExplore. Host grants are checked separately.
func (*Runtime) InsightMetricSets ¶
func (r *Runtime) InsightMetricSets(ctx context.Context, p data.Principal, read data.ExploreRead) ([]data.InsightMetricSet, error)
func (*Runtime) InspectIntent ¶
func (*Runtime) InspectPreview ¶
func (*Runtime) InspectReceipt ¶
func (*Runtime) LookupPreview ¶
func (*Runtime) OpenPreview ¶
func (r *Runtime) OpenPreview(ctx context.Context, w data.PreviewRecord, quota int) (data.PreviewRecord, error)
func (*Runtime) PreviewGuarantees ¶
func (*Runtime) PreviewGuarantees() data.PreviewGuarantees
func (*Runtime) PreviewOrdersReport ¶
func (r *Runtime) PreviewOrdersReport(ctx context.Context, read data.PreviewReadContext) (OrdersReport, error)
func (*Runtime) PreviewReadiness ¶
func (*Runtime) PrunePreviews ¶
type RuntimeOptions ¶
type RuntimeOptions struct {
Store sqlitestore.Options
PreviewCleanupInterval time.Duration
}
RuntimeOptions supplies one clock to the durable adapter and service tests. Cleanup is always enabled; the interval is bounded to at most one minute.