api

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes struct {
	Mode uint32 `json:"mode,omitempty"` // File mode (e.g., 0644)
}

Attributes defines optional metadata for nodes/leaves.

type Leaf

type Leaf struct {
	// Name of the file. Can be a template string.
	Name string `json:"name"`
	// ContentTemplate is the template string used to generate the file content.
	ContentTemplate string `json:"content_template"`
	// Attributes defines file permissions/metadata (optional).
	Attributes *Attributes `json:"attributes,omitempty"`
}

Leaf represents a file in the filesystem.

type Node

type Node struct {
	// Name of the directory. Can be a template string.
	Name string `json:"name"`
	// Selector is a query (e.g., JSONPath) to select data for this node context.
	Selector string `json:"selector,omitempty"`
	// SkipSelfMatch prevents the selector from matching the current context node itself.
	// Useful for recursive schemas to avoid infinite loops.
	SkipSelfMatch bool `json:"skip_self_match,omitempty"`
	// Language hint for multi-language schemas (e.g., "go", "terraform", "python").
	// Used to filter nodes during ingestion to prevent cross-language query errors.
	Language string `json:"language,omitempty"`
	// Children directories.
	Children []Node `json:"children,omitempty"`
	// Files within this directory.
	Files []Leaf `json:"files,omitempty"`
}

Node represents a directory in the filesystem. It can contain other nodes or leaves (files).

type Topology

type Topology struct {
	// Version of the Mache schema.
	Version string `json:"version"`
	// Table is the SQLite table name to query (default: "results").
	Table string `json:"table,omitempty"`
	// Root nodes of the filesystem.
	Nodes []Node `json:"nodes,omitempty"`
}

Topology represents the root configuration of the semantic overlay. It maps the input data source to a directory structure.

Jump to

Keyboard shortcuts

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