Documentation
¶
Index ¶
- Variables
- type AddConfig
- type AddOption
- type FileManager
- type LockFileManager
- func (m *LockFileManager) AddTool(ctx context.Context, tool, version string, opts ...AddOption) error
- func (m *LockFileManager) Enabled() bool
- func (m *LockFileManager) GetTools(ctx context.Context) (map[string][]string, error)
- func (m *LockFileManager) Name() string
- func (m *LockFileManager) RemoveTool(ctx context.Context, tool, version string) error
- func (m *LockFileManager) SetDefault(ctx context.Context, tool, version string) error
- func (m *LockFileManager) Verify(ctx context.Context) error
- type Registry
- func (r *Registry) AddTool(ctx context.Context, tool, version string, opts ...AddOption) error
- func (r *Registry) RemoveTool(ctx context.Context, tool, version string) error
- func (r *Registry) SetDefault(ctx context.Context, tool, version string) error
- func (r *Registry) VerifyAll(ctx context.Context) error
- type ToolVersionsFileManager
- func (m *ToolVersionsFileManager) AddTool(ctx context.Context, tool, version string, opts ...AddOption) error
- func (m *ToolVersionsFileManager) Enabled() bool
- func (m *ToolVersionsFileManager) GetTools(ctx context.Context) (map[string][]string, error)
- func (m *ToolVersionsFileManager) Name() string
- func (m *ToolVersionsFileManager) RemoveTool(ctx context.Context, tool, version string) error
- func (m *ToolVersionsFileManager) SetDefault(ctx context.Context, tool, version string) error
- func (m *ToolVersionsFileManager) Verify(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUpdateFailed indicates that updating file managers failed. ErrUpdateFailed = errors.New("update failed") // ErrVerificationFailed indicates that verification of file managers failed. ErrVerificationFailed = errors.New("verification failed") )
Sentinel errors for file manager operations.
Functions ¶
This section is empty.
Types ¶
type AddOption ¶
type AddOption func(*AddConfig)
AddOption configures tool addition behavior.
func WithAsDefault ¶
func WithAsDefault() AddOption
WithAsDefault adds the tool as the default version.
func WithChecksum ¶
WithChecksum adds checksum for lock file.
func WithPlatform ¶
WithPlatform specifies the platform for multi-platform lock files.
type FileManager ¶
type FileManager interface {
// Enabled returns true if this file manager is enabled by configuration.
Enabled() bool
// AddTool adds or updates a tool version.
AddTool(ctx context.Context, tool, version string, opts ...AddOption) error
// RemoveTool removes a tool version.
RemoveTool(ctx context.Context, tool, version string) error
// SetDefault sets a tool version as default.
SetDefault(ctx context.Context, tool, version string) error
// GetTools returns all tools managed by this file.
GetTools(ctx context.Context) (map[string][]string, error)
// Verify verifies the integrity of the managed file.
Verify(ctx context.Context) error
// Name returns the manager name for logging.
Name() string
}
FileManager manages a specific toolchain file type.
type LockFileManager ¶
type LockFileManager struct {
// contains filtered or unexported fields
}
LockFileManager manages toolchain.lock.yaml file.
func NewLockFileManager ¶
func NewLockFileManager(config *schema.AtmosConfiguration) *LockFileManager
NewLockFileManager creates a new lock file manager.
func (*LockFileManager) AddTool ¶
func (m *LockFileManager) AddTool(ctx context.Context, tool, version string, opts ...AddOption) error
AddTool adds or updates a tool version in the lock file with optional platform-specific metadata. Creates a new lock file if one doesn't exist. Platform metadata can be specified via AddOption parameters.
func (*LockFileManager) Enabled ¶
func (m *LockFileManager) Enabled() bool
Enabled returns true if this file manager is enabled by configuration.
func (*LockFileManager) GetTools ¶
GetTools returns all tools managed by the lock file as a map of tool names to version slices. Each tool maps to a single version (represented as a one-element slice).
func (*LockFileManager) Name ¶
func (m *LockFileManager) Name() string
Name returns the manager name for logging.
func (*LockFileManager) RemoveTool ¶
func (m *LockFileManager) RemoveTool(ctx context.Context, tool, version string) error
RemoveTool removes a tool version.
func (*LockFileManager) SetDefault ¶
func (m *LockFileManager) SetDefault(ctx context.Context, tool, version string) error
SetDefault sets a tool version as default.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry coordinates updates across multiple file managers.
func NewRegistry ¶
func NewRegistry(managers ...FileManager) *Registry
NewRegistry creates a new file manager registry.
func (*Registry) RemoveTool ¶
RemoveTool removes a tool from all enabled managers.
func (*Registry) SetDefault ¶
SetDefault sets a tool version as default in all enabled managers.
type ToolVersionsFileManager ¶
type ToolVersionsFileManager struct {
// contains filtered or unexported fields
}
ToolVersionsFileManager manages .tool-versions file.
func NewToolVersionsFileManager ¶
func NewToolVersionsFileManager(config *schema.AtmosConfiguration) *ToolVersionsFileManager
NewToolVersionsFileManager creates a new .tool-versions manager.
func (*ToolVersionsFileManager) AddTool ¶
func (m *ToolVersionsFileManager) AddTool(ctx context.Context, tool, version string, opts ...AddOption) error
AddTool adds or updates a tool version.
func (*ToolVersionsFileManager) Enabled ¶
func (m *ToolVersionsFileManager) Enabled() bool
Enabled returns true if this file manager is enabled by configuration.
func (*ToolVersionsFileManager) Name ¶
func (m *ToolVersionsFileManager) Name() string
Name returns the manager name for logging.
func (*ToolVersionsFileManager) RemoveTool ¶
func (m *ToolVersionsFileManager) RemoveTool(ctx context.Context, tool, version string) error
RemoveTool removes a tool version.
func (*ToolVersionsFileManager) SetDefault ¶
func (m *ToolVersionsFileManager) SetDefault(ctx context.Context, tool, version string) error
SetDefault sets a tool version as default.