config

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultVersion is the default Fedora version tag
	DefaultVersion = "latest"

	// ImageConfigFileName is the filename for base image configuration
	ImageConfigFileName = "image.json"

	// ClaudeConfigFileName is the filename for Claude agent configuration
	ClaudeConfigFileName = "claude.json"

	// GooseConfigFileName is the filename for Goose agent configuration
	GooseConfigFileName = "goose.json"

	// CursorConfigFileName is the filename for Cursor agent configuration
	CursorConfigFileName = "cursor.json"

	// OpenCodeConfigFileName is the filename for OpenCode agent configuration
	OpenCodeConfigFileName = "opencode.json"
)

Variables

View Source
var (
	// ErrInvalidPath is returned when a configuration path is invalid or empty
	ErrInvalidPath = errors.New("invalid configuration path")
	// ErrConfigNotFound is returned when a configuration file is not found
	ErrConfigNotFound = errors.New("configuration file not found for podman runtime and agent")
	// ErrInvalidConfig is returned when configuration validation fails
	ErrInvalidConfig = errors.New("invalid configuration")
)

Functions

This section is empty.

Types

type AgentConfig

type AgentConfig struct {
	Packages        []string `json:"packages"`
	RunCommands     []string `json:"run_commands"`
	TerminalCommand []string `json:"terminal_command"`
}

AgentConfig represents agent-specific configuration.

type Config

type Config interface {
	// LoadImage reads and parses the base image configuration from image.json.
	// Returns ErrConfigNotFound if the image.json file doesn't exist.
	// Returns ErrInvalidConfig if the configuration is invalid.
	LoadImage() (*ImageConfig, error)

	// LoadAgent reads and parses the agent-specific configuration.
	// Returns ErrConfigNotFound if the agent configuration file doesn't exist.
	// Returns ErrInvalidConfig if the configuration is invalid.
	LoadAgent(agentName string) (*AgentConfig, error)

	// ListAgents returns the names of all configured agents.
	// It scans the configuration directory for *.json files, excluding image.json.
	// Returns an empty slice if the directory does not exist.
	ListAgents() ([]string, error)

	// GenerateDefaults creates default configuration files if they don't exist.
	// Creates the configuration directory if it doesn't exist.
	// Does not overwrite existing configuration files.
	GenerateDefaults() error
}

Config represents a Podman runtime configuration manager. It manages the structure and contents of the Podman runtime configuration directory.

func NewConfig

func NewConfig(configDir string) (Config, error)

NewConfig creates a new Config for the specified configuration directory. The configDir is converted to an absolute path.

type ImageConfig

type ImageConfig struct {
	Version     string   `json:"version"`
	Packages    []string `json:"packages"`
	Sudo        []string `json:"sudo"`
	RunCommands []string `json:"run_commands"`
}

ImageConfig represents the base image configuration.

Jump to

Keyboard shortcuts

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