defaults

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package defaults holds the shipped configuration: file patterns, skipped folders, the data store table, heuristics, reserved domains, and the provider and agent catalogues. Everything that differs from repo to repo but has a sensible default lives here, as data, not in the plugins' code. See https://cernly.dev/how/config/.

Index

Constants

This section is empty.

Variables

View Source
var Agents []byte
View Source
var Providers []byte

Providers and Agents are the catalogues, versioned on their own; their packages parse them.

Functions

func Engine

func Engine(repository string) (string, bool)

Engine returns the data store engine of an image repository: the full path (mssql/server) first, then its last segment (postgres).

func IsCaddyfile

func IsCaddyfile(p string) bool

IsCaddyfile reports whether a path (or base name) is a Caddyfile.

func IsCompose

func IsCompose(p string) bool

IsCompose reports whether a path (or base name) is a Compose file.

func MatchBase

func MatchBase(globs []string, base string) bool

MatchBase reports whether a file's base name matches one of the globs.

Types

type AgentConfig

type AgentConfig struct {
	Tool  string   `yaml:"tool"`
	Name  string   `yaml:"name"`
	Paths []string `yaml:"paths"`
}

AgentConfig maps the files an AI coding tool leaves in a repo to the tool.

type Config

type Config struct {
	Version      string                       `yaml:"version"`
	MaxFileBytes int64                        `yaml:"max_file_bytes"`
	Files        Files                        `yaml:"files"`
	Engines      map[string]string            `yaml:"engines"`
	Drivers      map[string]map[string]string `yaml:"drivers"` // ecosystem -> package -> engine
	Outbound     Outbound                     `yaml:"outbound"`
	Domains      Domains                      `yaml:"domains"`
	AgentConfigs []AgentConfig                `yaml:"agent_configs"`
}

func Get

func Get() *Config

Get returns the shipped defaults. A broken embedded file is a programming error that any test run catches.

func (*Config) ConfigName

func (c *Config) ConfigName(name string) bool

ConfigName reports a const or var name that holds a configured URL.

func (*Config) IsHook

func (c *Config) IsHook(p string) bool

IsHook reports tracked hook configuration: a file in a hook folder (not in one of its skipped subfolders) or a named hook file.

type Domains

type Domains struct {
	ReservedTLDs []string `yaml:"reserved_tlds"`
	Example      []string `yaml:"example"`
}

type Files

type Files struct {
	Compose              []string      `yaml:"compose"`
	Dockerfile           []string      `yaml:"dockerfile"`
	Caddyfile            []string      `yaml:"caddyfile"`
	Prisma               []string      `yaml:"prisma"`
	Nginx                []string      `yaml:"nginx"`
	Traefik              []string      `yaml:"traefik"`
	SQLMigrations        SQLMigrations `yaml:"sql_migrations"`
	EnvExamples          []string      `yaml:"env_examples"`
	EnvExamplesByContent []string      `yaml:"env_examples_by_content"`
	Hooks                Hooks         `yaml:"hooks"`
	SkipDirs             []string      `yaml:"skip_dirs"`
}

type Hooks

type Hooks struct {
	Dirs     []string `yaml:"dirs"`
	SkipDirs []string `yaml:"skip_dirs"`
	Files    []string `yaml:"files"`
}

type Outbound

type Outbound struct {
	ConfigNameSuffixes []string `yaml:"config_name_suffixes"`
}

type SQLMigrations

type SQLMigrations struct {
	Paths    []string `yaml:"paths"`
	SetDirs  []string `yaml:"set_dirs"`
	Down     []string `yaml:"down"`
	SkipDirs []string `yaml:"skip_dirs"`
}

Jump to

Keyboard shortcuts

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