Help us shape the future of Go! Take the 2026 Go Developer Survey

profile

package
v1.233.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

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