maintenance

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package maintenance defines the data shapes and option vocabulary for den's admin-side operations — notably engine.DropStaleIndexes, the post-schema-change cleanup that drops indexes Den previously created but no longer recognises.

Application code reaches these as den.DropStaleIndexes, den.DryRun, den.StaleIndex, etc. Direct imports of this package are useful when writing helper tooling that itself takes ...maintenance.Option or returns a maintenance.DropStaleResult.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DryRun bool
}

Config holds the resolved option state for DropStaleIndexes. Exported so engine.DropStaleIndexes (and any future tooling) can read the flags it produced via Resolve.

func Resolve

func Resolve(opts ...Option) Config

Resolve applies the given options and returns the resulting Config.

type DropStaleResult

type DropStaleResult struct {
	Dropped []StaleIndex
	Kept    []StaleIndex
}

DropStaleResult summarizes a DropStaleIndexes call. Dropped contains the indexes that were (or would be, under DryRun) removed. Kept contains indexes that are still referenced by a current IndexDefinition.

type Option

type Option func(*Config)

Option configures DropStaleIndexes. Apply options via Resolve to derive the effective Config.

func DryRun

func DryRun() Option

DryRun causes DropStaleIndexes to report the indexes that would be dropped without actually dropping them.

type StaleIndex

type StaleIndex struct {
	Collection string
	Name       string
	Fields     []string
	Unique     bool
}

StaleIndex identifies an index inspected by DropStaleIndexes.

Jump to

Keyboard shortcuts

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