dataset

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package dataset exposes the freshness dataset read model and manual advance operation used by the REST controller and operator CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NamespaceFromPath

func NamespaceFromPath(raw string) string

NamespaceFromPath maps the REST path convention "_" to the v1 empty namespace. All other values are trimmed and used literally.

Types

type AdvanceParams

type AdvanceParams struct {
	Namespace string
	Name      string
	Watermark string
}

AdvanceParams carries a manual dataset arrival.

type AdvanceResult

type AdvanceResult struct {
	Outcome freshness.Outcome   `json:"outcome"`
	State   models.DatasetState `json:"state"`
}

AdvanceResult is the manual advance outcome plus the resulting state row.

type DerivationsParams

type DerivationsParams struct {
	Namespace string
	Name      string
	Limit     int
	Offset    int
}

DerivationsParams filters and paginates the append-only derivation audit.

type DerivationsResult

type DerivationsResult struct {
	Derivations []models.DatasetDerivation `json:"derivations"`
	Total       int64                      `json:"total"`
	Limit       int                        `json:"limit"`
	Offset      int                        `json:"offset"`
}

DerivationsResult is the paginated derivation audit response.

type Detail

type Detail struct {
	State        models.DatasetState        `json:"state"`
	Declaration  *models.DatasetDeclaration `json:"declaration,omitempty"`
	SLO          *SLO                       `json:"slo,omitempty"`
	Producing    *ProducingJob              `json:"producing_job,omitempty"`
	LastDecision *models.DatasetDerivation  `json:"last_decision,omitempty"`
}

Detail returns the state row plus the declaration metadata operators need to understand the SLO and producer.

type ListParams

type ListParams struct {
	Status string
	Limit  int
	Offset int
}

ListParams filters and paginates the dataset feed.

type ListResult

type ListResult struct {
	Datasets []models.DatasetState `json:"datasets"`
	Total    int64                 `json:"total"`
	Limit    int                   `json:"limit"`
	Offset   int                   `json:"offset"`
}

ListResult is the paginated dataset state response.

type ProducingJob

type ProducingJob struct {
	ID       uuid.UUID `json:"id"`
	Alias    string    `json:"alias"`
	StepName string    `json:"step_name,omitempty"`
}

ProducingJob identifies the Caesium job and step that produce a dataset.

type SLO

type SLO struct {
	Freshness     string `json:"freshness,omitempty"`
	MaxStaleness  string `json:"max_staleness,omitempty"`
	ExpectedEvery string `json:"expected_every,omitempty"`
}

SLO summarizes the declaration-level freshness contract for a dataset.

type Service

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

Service wraps read-side dataset queries and the manual advance path.

func New

func New(ctx context.Context) *Service

New creates a Service backed by the default DB connection.

func (*Service) Advance

func (s *Service) Advance(p AdvanceParams) (*AdvanceResult, error)

Advance applies a manual arrival through the freshness.Store contract.

func (*Service) Derivations

func (s *Service) Derivations(p DerivationsParams) (*DerivationsResult, error)

Derivations returns the append-only derivation audit newest-first.

func (*Service) Get

func (s *Service) Get(namespace, name string) (*Detail, error)

Get returns one dataset's state plus declaration metadata. A declared dataset with no state row is served as unknown rather than 404.

func (*Service) List

func (s *Service) List(p ListParams) (*ListResult, error)

List returns a bounded, paginated, filtered slice of dataset states newest-first. Declared-but-unobserved produced/source datasets are surfaced as synthetic unknown state so operators can see the declared graph before a run advances anything.

func (*Service) WithDatabase

func (s *Service) WithDatabase(conn *gorm.DB) *Service

WithDatabase returns a copy of the Service backed by conn; used by tests.

Jump to

Keyboard shortcuts

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