Documentation
¶
Index ¶
- func HasDockerSocket() bool
- func IsDarwin() bool
- func IsLinux() bool
- func IsWindows() bool
- func MacOSMajorVersion() int
- func NormalizeName(name string) string
- type Paths
- func (p *Paths) AgentPIDFile() string
- func (p *Paths) BinDir() string
- func (p *Paths) CacheDir() string
- func (p *Paths) ConfigDir() string
- func (p *Paths) ConnectionsDir() string
- func (p *Paths) CurrentOSConfigDir() string
- func (p *Paths) CurrentOSLogsDir() string
- func (p *Paths) EnsureAllDirs() error
- func (p *Paths) EnsureStudioDirs(name string) error
- func (p *Paths) GlobPattern(prefix string) string
- func (p *Paths) LDSoConfPath(name string) string
- func (p *Paths) LDSoPreloadPath(name string) string
- func (p *Paths) LibDir() string
- func (p *Paths) LibsDir() string
- func (p *Paths) LibsDirForPlatform(targetOS, arch string) string
- func (p *Paths) StateDir() string
- func (p *Paths) StudioConfigDir(name string) string
- func (p *Paths) StudioDir() string
- func (p *Paths) StudioLogFilePath(name string) string
- func (p *Paths) StudioLogsDir(name string) string
- func (p *Paths) TempDir() string
- func (p *Paths) UserDir() string
- func (p *Paths) WithConfigDir(dir string) *Paths
- func (p *Paths) WithStateDir(dir string) *Paths
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasDockerSocket ¶ added in v1.2.0
func HasDockerSocket() bool
HasDockerSocket checks common Docker socket locations for macOS runtimes.
func MacOSMajorVersion ¶ added in v1.2.0
func MacOSMajorVersion() int
MacOSMajorVersion returns 0 on non-macOS platforms.
func NormalizeName ¶ added in v1.1.7
NormalizeName normalizes a string to be a valid folder name - Converts to lowercase - Replaces spaces and special chars with hyphens - Removes consecutive hyphens - Trims leading/trailing hyphens
Types ¶
type Paths ¶
type Paths struct {
// contains filtered or unexported fields
}
Paths provides cross-platform path resolution for ggo
func DefaultPaths ¶
func DefaultPaths() *Paths
DefaultPaths returns the default paths for the current platform All paths are stored in the user directory (~/.gpugo)
func (*Paths) AgentPIDFile ¶
AgentPIDFile returns the path to the agent PID file All platforms: ~/.gpugo/state/agent.pid (or StateDir/agent.pid)
func (*Paths) BinDir ¶
BinDir returns the directory for binaries All platforms: ~/.gpugo/bin (or UserDir/bin)
func (*Paths) CacheDir ¶
CacheDir returns the cache directory for downloaded files All platforms: ~/.gpugo/cache (or UserDir/cache)
func (*Paths) ConfigDir ¶
ConfigDir returns the configuration directory All platforms: ~/.gpugo/config (or UserDir/config)
func (*Paths) ConnectionsDir ¶ added in v1.1.6
ConnectionsDir returns the directory for worker connection files Each worker writes its connections to a separate file: {workerID}.txt All platforms: ~/.gpugo/state/connections (or StateDir/connections)
func (*Paths) CurrentOSConfigDir ¶ added in v1.1.7
CurrentOSConfigDir returns the config directory for the current OS (used by ggo use) All platforms: ~/.gpugo/studio/current-os/config
func (*Paths) CurrentOSLogsDir ¶ added in v1.1.7
CurrentOSLogsDir returns the logs directory for the current OS (used by ggo use) All platforms: ~/.gpugo/studio/current-os/logs
func (*Paths) EnsureAllDirs ¶
EnsureAllDirs creates all required directories
func (*Paths) EnsureStudioDirs ¶ added in v1.1.7
EnsureStudioDirs creates all required directories for a studio
func (*Paths) GlobPattern ¶
GlobPattern returns the platform-appropriate glob pattern for temp cleanup
func (*Paths) LDSoConfPath ¶ added in v1.1.7
LDSoConfPath returns the path to the ld.so.conf.d file for a studio This file will be mounted to /etc/ld.so.conf.d/zz_tensor-fusion.conf in containers
func (*Paths) LDSoPreloadPath ¶ added in v1.1.7
LDSoPreloadPath returns the path to the ld.so.preload file for a studio This file will be mounted to /etc/ld.so.preload in containers
func (*Paths) LibDir ¶
LibDir returns the directory for shared libraries All platforms: ~/.gpugo/lib (or UserDir/lib)
func (*Paths) LibsDir ¶ added in v1.1.18
LibsDir returns the directory for downloaded .so/.dll library files This is separate from CacheDir which contains all downloaded files (including binaries) The libs directory is used for LD_LIBRARY_PATH, ld.so.conf, and ld.so.preload All platforms: ~/.gpugo/cache/libs (or CacheDir/libs) Used by agent/worker which always runs on the native host architecture.
func (*Paths) LibsDirForPlatform ¶ added in v1.5.0
LibsDirForPlatform returns the arch-specific libs directory for a given OS and architecture. This is used by studio/use/launch which may download libraries for a different platform (e.g., linux/amd64 libs on an arm64 Mac). Layout: ~/.gpugo/cache/libs/{os}-{arch} (e.g., ~/.gpugo/cache/libs/linux-amd64)
func (*Paths) StateDir ¶
StateDir returns the state directory for runtime data All platforms: ~/.gpugo/state (or UserDir/state)
func (*Paths) StudioConfigDir ¶ added in v1.1.7
StudioConfigDir returns the config directory for a specific studio Used for storing ld.so.preload and ld.so.conf content for the studio All platforms: ~/.gpugo/studio/{name}/config
func (*Paths) StudioDir ¶ added in v1.1.7
StudioDir returns the directory for studio configurations All platforms: ~/.gpugo/studio (or UserDir/studio)
func (*Paths) StudioLogFilePath ¶ added in v1.4.1
StudioLogFilePath returns the path to the daily log file for a studio Format: ~/.gpugo/studio/{name}/logs/logs-YYYY-mm-dd.txt Caller must ensure the parent directory exists (e.g. via EnsureStudioDirs or MkdirAll on StudioLogsDir)
func (*Paths) StudioLogsDir ¶ added in v1.1.7
StudioLogsDir returns the logs directory for a specific studio name: the normalized studio name (use NormalizeName to sanitize) All platforms: ~/.gpugo/studio/{name}/logs
func (*Paths) UserDir ¶
UserDir returns the user-specific directory - Linux: ~/.gpugo - macOS: ~/.gpugo - Windows: %USERPROFILE%\.gpugo
func (*Paths) WithConfigDir ¶
WithConfigDir returns a new Paths with a custom config directory
func (*Paths) WithStateDir ¶
WithStateDir returns a new Paths with a custom state directory