profile

package
v1.235.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayPath added in v1.223.0

func DisplayPath(path string) string

DisplayPath returns a compact, user-facing path for profile output. Project-local paths are shown relative to the current command directory when that does not require "../" traversal. Home-local paths use "~"; everything else stays absolute so the location remains unambiguous.

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