diff

package
v0.0.6-beta Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diff

type Diff struct {
	Component string `json:"component"`
	Action    string `json:"action"`
	Target    string `json:"target"`
	Current   string `json:"current"`
	Proposed  string `json:"proposed"`
	Risk      string `json:"risk"`
}

func Compare

func Compare(live, target SchemaSpec) []Diff

type IndexSpec

type IndexSpec struct {
	Collection         string
	Name               string
	Keys               bson.D
	Unique             bool
	Sparse             bool
	PartialFilter      bson.D
	ExpireAfterSeconds *int32
}

type SchemaSpec

type SchemaSpec struct {
	Collections map[string]struct{}
	Indexes     map[string]map[string]IndexSpec
	Validators  map[string]ValidatorSpec
}

func FromRegistry

func FromRegistry() SchemaSpec

FromRegistry builds the desired schema spec from in-code registries.

func InspectLive

func InspectLive(ctx context.Context, db *mongo.Database) (SchemaSpec, error)

func NewSchemaSpec

func NewSchemaSpec() SchemaSpec

type ValidatorSpec

type ValidatorSpec struct {
	Collection string
	Schema     bson.M
	Level      string
}

Jump to

Keyboard shortcuts

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