config

package
v1.0.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 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 CacheConfig

type CacheConfig struct {
	Enabled   bool `yaml:"enabled"`
	TTLHours  int  `yaml:"ttl_hours"`
	MaxSizeMB int  `yaml:"max_size_mb"`
	RefreshBg bool `yaml:"refresh_background"`
}

CacheConfig for marketplace caching

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 DefaultsConfig

type DefaultsConfig struct {
	Format string `yaml:"format,omitempty"`
	Limit  int    `yaml:"limit,omitempty"`
	Fuzzy  bool   `yaml:"fuzzy"`
}

DefaultsConfig contains query defaults

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 IndexConfig

type IndexConfig struct {
	Path            string        `yaml:"path,omitempty"`
	AutoUpdate      bool          `yaml:"auto_update"`
	RebuildInterval time.Duration `yaml:"rebuild_interval,omitempty"`
}

IndexConfig contains index configuration

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 QueryCacheConfig

type QueryCacheConfig struct {
	Enabled bool          `yaml:"enabled"`
	TTL     time.Duration `yaml:"ttl,omitempty"`
	MaxSize string        `yaml:"max_size,omitempty"`
}

QueryCacheConfig contains query cache configuration

type QueryConfig

type QueryConfig struct {
	Enabled    bool             `yaml:"enabled"`
	Index      IndexConfig      `yaml:"index,omitempty"`
	Cache      QueryCacheConfig `yaml:"cache,omitempty"`
	Validation ValidationConfig `yaml:"validation,omitempty"`
	Defaults   DefaultsConfig   `yaml:"defaults,omitempty"`
}

QueryConfig contains query engine configuration

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"`
	Query               QueryConfig   `yaml:"query,omitempty"`
}

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"`
	// Marketplace-specific fields
	Category       string      `yaml:"category,omitempty"`        // Filter by marketplace category
	MarketplaceURL string      `yaml:"marketplace_url,omitempty"` // Custom marketplace URL
	Cache          CacheConfig `yaml:"cache,omitempty"`           // Cache configuration
}

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

type ValidationConfig

type ValidationConfig struct {
	CheckNameFormat     bool `yaml:"check_name_format"`
	CheckRequiredFields bool `yaml:"check_required_fields"`
	CheckToolValidity   bool `yaml:"check_tool_validity"`
}

ValidationConfig contains validation settings

Jump to

Keyboard shortcuts

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