profile

package
v1.202.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultProfileManager

type DefaultProfileManager struct{}

DefaultProfileManager is the concrete implementation of ProfileManager.

func (*DefaultProfileManager) GetProfile

func (m *DefaultProfileManager) GetProfile(atmosConfig *schema.AtmosConfiguration, profileName string) (*ProfileInfo, error)

GetProfile returns detailed information about a specific profile.

func (*DefaultProfileManager) GetProfileLocations

func (m *DefaultProfileManager) GetProfileLocations(atmosConfig *schema.AtmosConfiguration) ([]ProfileLocation, error)

GetProfileLocations returns all possible profile locations in precedence order.

func (*DefaultProfileManager) ListProfiles

func (m *DefaultProfileManager) ListProfiles(atmosConfig *schema.AtmosConfiguration) ([]ProfileInfo, error)

ListProfiles returns all available profiles across all locations.

type ProfileInfo

type ProfileInfo struct {
	Name         string                 // Profile name (directory name).
	Path         string                 // Absolute path to profile directory.
	LocationType string                 // Location type: "configurable", "project-hidden", "xdg", "project".
	Files        []string               // List of configuration files in the profile.
	Metadata     *schema.ConfigMetadata // Optional metadata from the profile.
}

ProfileInfo contains information about a discovered profile.

type ProfileLocation

type ProfileLocation struct {
	Path       string // Absolute path to profile directory.
	Type       string // "configurable", "project-hidden", "xdg", "project".
	Precedence int    // Lower number = higher precedence.
	Exists     bool   // Whether the directory exists.
}

ProfileLocation represents a location where profiles can be stored.

type ProfileManager

type ProfileManager interface {
	// ListProfiles returns all available profiles across all locations.
	ListProfiles(atmosConfig *schema.AtmosConfiguration) ([]ProfileInfo, error)

	// GetProfile returns detailed information about a specific profile.
	GetProfile(atmosConfig *schema.AtmosConfiguration, profileName string) (*ProfileInfo, error)

	// GetProfileLocations returns all possible profile locations in precedence order.
	GetProfileLocations(atmosConfig *schema.AtmosConfiguration) ([]ProfileLocation, error)
}

ProfileManager defines the interface for profile operations. This interface allows for testing with mocks and provides a clean API for profile management.

func NewProfileManager

func NewProfileManager() ProfileManager

NewProfileManager creates a new DefaultProfileManager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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