config

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(cfg *Config, path string) error

Save writes the configuration to a file

func Validate

func Validate(cfg *Config) error

Validate checks if the configuration is valid

func ValidateAccess

func ValidateAccess(cfg *Config) error

ValidateAccess checks if the required tools and permissions are available

Types

type AuthConfig

type AuthConfig struct {
	Method   string `yaml:"method,omitempty"`
	TokenEnv string `yaml:"token_env,omitempty"`
	SSHKey   string `yaml:"ssh_key,omitempty"`
}

AuthConfig contains authentication settings

type Config

type Config struct {
	Version  string   `yaml:"version"`
	Settings Settings `yaml:"settings"`
	Sources  []Source `yaml:"sources"`
	Metadata Metadata `yaml:"metadata"`
}

Config represents the complete configuration

func Load

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

Load reads and parses the configuration file

type ExcludeFilter

type ExcludeFilter struct {
	Patterns []string `yaml:"patterns,omitempty"`
}

ExcludeFilter contains exclusion rules

type FilterConfig

type FilterConfig struct {
	Include IncludeFilter `yaml:"include,omitempty"`
	Exclude ExcludeFilter `yaml:"exclude,omitempty"`
}

FilterConfig contains include/exclude filters

type IncludeFilter

type IncludeFilter struct {
	Extensions []string `yaml:"extensions,omitempty"`
	Patterns   []string `yaml:"patterns,omitempty"`
	Regex      []string `yaml:"regex,omitempty"`
}

IncludeFilter contains inclusion rules

type Metadata

type Metadata struct {
	TrackingFile string `yaml:"tracking_file"`
	LogFile      string `yaml:"log_file"`
	LockFile     string `yaml:"lock_file,omitempty"`
}

Metadata contains tracking and logging configuration

type PathConfig

type PathConfig struct {
	Source string `yaml:"source"`
	Target string `yaml:"target"`
}

PathConfig contains source and target paths

type PostInstall

type PostInstall struct {
	Type string   `yaml:"type"`
	Path string   `yaml:"path,omitempty"`
	Args []string `yaml:"args,omitempty"`
}

PostInstall represents a post-installation action

type Settings

type Settings struct {
	BaseDir             string        `yaml:"base_dir"`
	DocsDir             string        `yaml:"docs_dir"`
	ConflictStrategy    string        `yaml:"conflict_strategy"`
	BackupDir           string        `yaml:"backup_dir"`
	LogLevel            string        `yaml:"log_level"`
	ConcurrentDownloads int           `yaml:"concurrent_downloads"`
	Timeout             time.Duration `yaml:"timeout"`
	ContinueOnError     bool          `yaml:"continue_on_error"`
}

Settings contains global settings

type Source

type Source struct {
	Name             string           `yaml:"name"`
	Enabled          bool             `yaml:"enabled"`
	Type             string           `yaml:"type"`
	Repository       string           `yaml:"repository,omitempty"`
	URL              string           `yaml:"url,omitempty"`
	Branch           string           `yaml:"branch,omitempty"`
	Auth             AuthConfig       `yaml:"auth,omitempty"`
	Paths            PathConfig       `yaml:"paths"`
	Filters          FilterConfig     `yaml:"filters,omitempty"`
	Transformations  []Transformation `yaml:"transformations,omitempty"`
	PostInstall      []PostInstall    `yaml:"post_install,omitempty"`
	ConflictStrategy string           `yaml:"conflict_strategy,omitempty"`
	Watch            bool             `yaml:"watch,omitempty"`
}

Source represents an agent source

type Transformation

type Transformation struct {
	Type          string   `yaml:"type"`
	Pattern       string   `yaml:"pattern,omitempty"`
	SourcePattern string   `yaml:"source_pattern,omitempty"`
	TargetDir     string   `yaml:"target_dir,omitempty"`
	Naming        string   `yaml:"naming,omitempty"`
	Script        string   `yaml:"script,omitempty"`
	Args          []string `yaml:"args,omitempty"`
}

Transformation represents a file transformation

Jump to

Keyboard shortcuts

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