atlas

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderFile      = "atlas.json"
	DiagnosticsFile = "diagnostics.jsonl"
	ShardsDir       = "shards"
)
View Source
const (
	SchemaVersion = "gonimbus.atlas.v1"

	HashProfileSHA256 = "sha256"

	DimensionTemporalDay     = "temporal-day"
	DimensionTemporalInstant = "temporal-instant"
	DimensionCategorical     = "categorical"

	ClassificationUnknown      = "unknown"
	ClassificationPublic       = "0-public"
	ClassificationConfidential = "1-confidential"
	ClassificationBlinded      = "2-blinded"
	ClassificationProprietary  = "3-proprietary"
	ClassificationPersonal     = "4-personal"
	ClassificationPrivileged   = "5-privileged"
	ClassificationEyesOnly     = "6-eyes-only"

	CoverageFull   = "full"
	CoverageScoped = "scoped"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildOptions

type BuildOptions struct {
	Source    SourceRun
	Recipe    Recipe
	Reader    provider.ObjectGetter
	OutputDir string
	Now       func() time.Time
}

type BuildResult

type BuildResult struct {
	Header    Header
	OutputDir string
}

func Build

func Build(ctx context.Context, opts BuildOptions) (*BuildResult, error)

type Counts

type Counts struct {
	ObjectsScanned       int64 `json:"objects_scanned"`
	RowsWritten          int64 `json:"rows_written"`
	Diagnostics          int64 `json:"diagnostics"`
	ReadFailures         int64 `json:"read_failures"`
	ExtractionFailures   int64 `json:"extraction_failures"`
	ValidationFailures   int64 `json:"validation_failures"`
	ArtifactWriteFailure int64 `json:"artifact_write_failures,omitempty"`
}

type DiagnosticRow

type DiagnosticRow struct {
	SchemaVersion    string    `json:"schema_version"`
	SourceIndexSetID string    `json:"source_index_set_id"`
	SourceRunID      string    `json:"source_run_id"`
	StorageKey       string    `json:"storage_key"`
	RelKey           string    `json:"rel_key"`
	Stage            string    `json:"stage"`
	Code             string    `json:"code"`
	Message          string    `json:"message"`
	OccurredAt       time.Time `json:"occurred_at"`
}

type DimensionDeclaration

type DimensionDeclaration struct {
	Name           string `json:"name"`
	Kind           string `json:"kind"`
	Classification string `json:"classification"`
}

type DimensionRecipe

type DimensionRecipe struct {
	Name           string                `json:"name" yaml:"name"`
	Kind           string                `json:"kind" yaml:"kind"`
	From           string                `json:"from,omitempty" yaml:"from,omitempty"`
	Classification string                `json:"classification,omitempty" yaml:"classification,omitempty"`
	Extractor      probe.ExtractorConfig `json:"extractor" yaml:"extractor"`
}

type FieldPolicy

type FieldPolicy struct {
	Classification string `json:"classification" yaml:"classification"`
}
type Header struct {
	SchemaVersion    string                   `json:"schema_version"`
	AtlasID          string                   `json:"atlas_id"`
	CreatedAt        time.Time                `json:"created_at"`
	SourceIndexSetID string                   `json:"source_index_set_id"`
	SourceRunID      string                   `json:"source_run_id"`
	BaseURI          string                   `json:"base_uri"`
	ScopeDigest      string                   `json:"scope_digest"`
	RecipeDigest     string                   `json:"recipe_digest"`
	HashProfile      string                   `json:"hash_profile"`
	Coverage         string                   `json:"coverage"`
	ShardBy          []string                 `json:"shard_by"`
	Dimensions       []DimensionDeclaration   `json:"dimensions"`
	SystemFields     []SystemFieldDeclaration `json:"system_fields"`
	Counts           Counts                   `json:"counts"`
}

func ReadHeader

func ReadHeader(dir string) (*Header, error)

type ObjectRow

type ObjectRow struct {
	SchemaVersion    string            `json:"schema_version"`
	SourceIndexSetID string            `json:"source_index_set_id"`
	SourceRunID      string            `json:"source_run_id"`
	StorageKey       string            `json:"storage_key"`
	RelKey           string            `json:"rel_key"`
	SourceURI        string            `json:"source_uri"`
	ContentHash      string            `json:"content_hash"`
	HashProfile      string            `json:"hash_profile"`
	Dimensions       map[string]string `json:"dimensions"`
	Shard            map[string]string `json:"shard"`
	SizeBytes        int64             `json:"size_bytes"`
	ETag             string            `json:"etag,omitempty"`
	FirstSeenRunID   string            `json:"first_seen_run_id"`
	FirstSeenAt      time.Time         `json:"first_seen_at"`
}

type Recipe

type Recipe struct {
	Schema       string                 `json:"$schema,omitempty" yaml:"$schema,omitempty"`
	Version      string                 `json:"version,omitempty" yaml:"version,omitempty"`
	Hash         string                 `json:"hash,omitempty" yaml:"hash,omitempty"`
	Coverage     string                 `json:"coverage,omitempty" yaml:"coverage,omitempty"`
	Dimensions   []DimensionRecipe      `json:"dimensions" yaml:"dimensions"`
	ShardBy      []string               `json:"shard_by" yaml:"shard_by"`
	SystemFields map[string]FieldPolicy `json:"system_fields,omitempty" yaml:"system_fields,omitempty"`
}

func LoadRecipeFile

func LoadRecipeFile(path string) (*Recipe, error)

func (Recipe) Digest

func (r Recipe) Digest() (string, error)

func (Recipe) DimensionDeclarations

func (r Recipe) DimensionDeclarations() []DimensionDeclaration

func (Recipe) ProbeConfig

func (r Recipe) ProbeConfig() probe.Config

func (Recipe) SystemFieldDeclarations

func (r Recipe) SystemFieldDeclarations() []SystemFieldDeclaration

func (*Recipe) Validate

func (r *Recipe) Validate() error

type SourceObject

type SourceObject struct {
	RelKey        string
	SizeBytes     int64
	ETag          string
	LastSeenRunID string
	LastSeenAt    time.Time
}

type SourceRun

type SourceRun struct {
	IndexSetID  string
	RunID       string
	BaseURI     string
	ScopeDigest string
	Coverage    string
	Objects     []SourceObject
}

type Stats

type Stats struct {
	Header       Header `json:"header"`
	Tier1Keys    int64  `json:"tier1_keys"`
	Tier2Content int64  `json:"tier2_content"`
	Tier3Shards  int64  `json:"tier3_shard_content"`
	Diagnostics  int64  `json:"diagnostics"`
	ShardFiles   int    `json:"shard_files"`
}

func ComputeStats

func ComputeStats(dir string) (*Stats, error)

type SystemFieldDeclaration

type SystemFieldDeclaration struct {
	Name           string `json:"name"`
	Classification string `json:"classification"`
}

func DefaultSystemFields

func DefaultSystemFields() []SystemFieldDeclaration

Jump to

Keyboard shortcuts

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