config

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config handles configuration discovery and loading for the GCO CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverSchemaFiles

func DiscoverSchemaFiles(roots []string) ([]string, error)

DiscoverSchemaFiles finds all .gcorm files in the given roots with deterministic ordering.

func DiscoverSchemaRoots

func DiscoverSchemaRoots(cfg *Config, cwd string) ([]string, error)

DiscoverSchemaRoots finds schema root directories.

Types

type Config

type Config struct {
	SchemaRoots       []string          `yaml:"schemaRoots"`
	MigrationDir      string            `yaml:"migrationDir"`
	ShadowDatabaseURL string            `yaml:"shadowDatabaseURL"`
	Generators        map[string]string `yaml:"generators"`
	Format            *FormatConfig     `yaml:"format"`
}

Config represents the GCORM configuration.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a config with sensible defaults.

func Load

func Load(explicitPath string) (*Config, string, error)

Load discovers and loads configuration following priority order: 1. Explicit --config path 2. gco.config.yaml or gco.config.yml in current directory 3. Recursive parent search (up to 5 levels) 4. GCO_CONFIG environment variable

type FormatConfig

type FormatConfig struct {
	IndentWidth int `yaml:"indentWidth"`
}

FormatConfig holds formatting configuration.

Jump to

Keyboard shortcuts

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