config

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package config provides configuration management functionality for the CM application.

Package config is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Configuration file errors.
	ErrConfigFileParse = errors.New("failed to parse config file")
	// Configuration validation errors.
	ErrBasePathEmpty = errors.New("base_path cannot be empty")
	// Configuration initialization errors.
	ErrConfigNotInitialized = errors.New("CM configuration not found. Run 'cm init' to initialize")
)

Error definitions for config package.

Functions

This section is empty.

Types

type Config

type Config struct {
	BasePath   string `yaml:"base_path"`   // User's code directory (default: ~/Code)
	StatusFile string `yaml:"status_file"` // Status file path (default: ~/.cm/status.yaml)
}

Config represents the application configuration.

func LoadConfigWithFallback

func LoadConfigWithFallback(configPath string) (*Config, error)

LoadConfigWithFallback loads configuration from file with fallback to default.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the configuration values.

type Manager

type Manager interface {
	LoadConfig(configPath string) (*Config, error)
	LoadConfigStrict(configPath string) (*Config, error)
	DefaultConfig() *Config
	SaveConfig(config *Config, configPath string) error
	CreateConfigDirectory(configPath string) error
	ValidateBasePath(basePath string) error
	EnsureConfigFile(configPath string) (*Config, bool, error)
}

Manager interface provides configuration management functionality.

func NewManager

func NewManager() Manager

NewManager creates a new Manager instance.

type MockManager

type MockManager struct {
	// contains filtered or unexported fields
}

MockManager is a mock of Manager interface.

func NewMockManager

func NewMockManager(ctrl *gomock.Controller) *MockManager

NewMockManager creates a new mock instance.

func (*MockManager) CreateConfigDirectory

func (m *MockManager) CreateConfigDirectory(configPath string) error

CreateConfigDirectory mocks base method.

func (*MockManager) DefaultConfig

func (m *MockManager) DefaultConfig() *Config

DefaultConfig mocks base method.

func (*MockManager) EXPECT

func (m *MockManager) EXPECT() *MockManagerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockManager) EnsureConfigFile

func (m *MockManager) EnsureConfigFile(configPath string) (*Config, bool, error)

EnsureConfigFile mocks base method.

func (*MockManager) LoadConfig

func (m *MockManager) LoadConfig(configPath string) (*Config, error)

LoadConfig mocks base method.

func (*MockManager) LoadConfigStrict

func (m *MockManager) LoadConfigStrict(configPath string) (*Config, error)

LoadConfigStrict mocks base method.

func (*MockManager) SaveConfig

func (m *MockManager) SaveConfig(config *Config, configPath string) error

SaveConfig mocks base method.

func (*MockManager) ValidateBasePath

func (m *MockManager) ValidateBasePath(basePath string) error

ValidateBasePath mocks base method.

type MockManagerMockRecorder

type MockManagerMockRecorder struct {
	// contains filtered or unexported fields
}

MockManagerMockRecorder is the mock recorder for MockManager.

func (*MockManagerMockRecorder) CreateConfigDirectory

func (mr *MockManagerMockRecorder) CreateConfigDirectory(configPath any) *gomock.Call

CreateConfigDirectory indicates an expected call of CreateConfigDirectory.

func (*MockManagerMockRecorder) DefaultConfig

func (mr *MockManagerMockRecorder) DefaultConfig() *gomock.Call

DefaultConfig indicates an expected call of DefaultConfig.

func (*MockManagerMockRecorder) EnsureConfigFile

func (mr *MockManagerMockRecorder) EnsureConfigFile(configPath any) *gomock.Call

EnsureConfigFile indicates an expected call of EnsureConfigFile.

func (*MockManagerMockRecorder) LoadConfig

func (mr *MockManagerMockRecorder) LoadConfig(configPath any) *gomock.Call

LoadConfig indicates an expected call of LoadConfig.

func (*MockManagerMockRecorder) LoadConfigStrict

func (mr *MockManagerMockRecorder) LoadConfigStrict(configPath any) *gomock.Call

LoadConfigStrict indicates an expected call of LoadConfigStrict.

func (*MockManagerMockRecorder) SaveConfig

func (mr *MockManagerMockRecorder) SaveConfig(config, configPath any) *gomock.Call

SaveConfig indicates an expected call of SaveConfig.

func (*MockManagerMockRecorder) ValidateBasePath

func (mr *MockManagerMockRecorder) ValidateBasePath(basePath any) *gomock.Call

ValidateBasePath indicates an expected call of ValidateBasePath.

Jump to

Keyboard shortcuts

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