Documentation
¶
Index ¶
- func FindProjectConfigDir() string
- func GetConfigDir() string
- func GetConfigPath() string
- func GetConfigValue(key string) interface{}
- func GetProjectConfigDir(projectPath string) string
- func GetProjectRegistryPath() string
- func GetSessionsPath() string
- func GetTmuxTemplatePath() string
- func GetUpdateCheckPath() (string, error)
- func SaveConfig(cfg *Config) error
- func SaveUpdateCheckState(state *UpdateCheckState) error
- func SetConfigValue(key string, value interface{}) error
- func ShouldCheckForUpdates(lastCheck time.Time, interval time.Duration) bool
- type Config
- type Project
- type ProjectRegistry
- func (r *ProjectRegistry) AddProject(alias string, project *Project) error
- func (r *ProjectRegistry) FindProjectByPath(path string) (string, *Project, error)
- func (r *ProjectRegistry) GetProject(alias string) (*Project, error)
- func (r *ProjectRegistry) RemoveProject(alias string) error
- func (r *ProjectRegistry) Save() error
- type UpdateCheckState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindProjectConfigDir ¶
func FindProjectConfigDir() string
FindProjectConfigDir searches for a .devx directory starting from the current working directory and walking up the directory tree. Returns the path to the .devx directory if found, or empty string if not found.
func GetConfigDir ¶
func GetConfigDir() string
GetConfigDir returns the config directory path, checking project-level first
func GetConfigPath ¶
func GetConfigPath() string
GetConfigPath returns the path to the config file, checking project-level first
func GetConfigValue ¶
func GetConfigValue(key string) interface{}
func GetProjectConfigDir ¶
GetProjectConfigDir returns the .devx directory path for a project
func GetProjectRegistryPath ¶
func GetProjectRegistryPath() string
GetProjectRegistryPath returns the path to the projects.json file
func GetSessionsPath ¶
func GetSessionsPath() string
GetSessionsPath returns the path to the sessions.json file For multi-project support, we always use the global sessions file
func GetTmuxTemplatePath ¶
func GetTmuxTemplatePath() string
GetTmuxTemplatePath returns the path to the session.yaml.tmpl file, checking project-level first
func GetUpdateCheckPath ¶ added in v0.1.1
GetUpdateCheckPath returns the path to the update check state file
func SaveConfig ¶
func SaveUpdateCheckState ¶ added in v0.1.1
func SaveUpdateCheckState(state *UpdateCheckState) error
SaveUpdateCheckState saves the update check state to disk
func SetConfigValue ¶
Types ¶
type Config ¶
type Config struct {
BaseDomain string `mapstructure:"basedomain"`
CaddyAPI string `mapstructure:"caddy_api"`
TmuxpTemplate string `mapstructure:"tmuxp_template"`
Ports []string `mapstructure:"ports"`
}
func GetProjectConfig ¶
GetProjectConfig loads the config for a specific project
func LoadConfig ¶
type Project ¶
type Project struct {
Name string `json:"name"`
Path string `json:"path"`
Description string `json:"description,omitempty"`
DefaultBranch string `json:"default_branch,omitempty"`
AutoPullOnCreate bool `json:"auto_pull_on_create,omitempty"`
}
Project represents a registered project in devx
type ProjectRegistry ¶
ProjectRegistry manages multiple projects
func LoadProjectRegistry ¶
func LoadProjectRegistry() (*ProjectRegistry, error)
LoadProjectRegistry loads the project registry from the projects.json file
func (*ProjectRegistry) AddProject ¶
func (r *ProjectRegistry) AddProject(alias string, project *Project) error
AddProject adds a new project to the registry
func (*ProjectRegistry) FindProjectByPath ¶
func (r *ProjectRegistry) FindProjectByPath(path string) (string, *Project, error)
FindProjectByPath searches for a project by its path
func (*ProjectRegistry) GetProject ¶
func (r *ProjectRegistry) GetProject(alias string) (*Project, error)
GetProject retrieves a project by alias
func (*ProjectRegistry) RemoveProject ¶
func (r *ProjectRegistry) RemoveProject(alias string) error
RemoveProject removes a project from the registry
func (*ProjectRegistry) Save ¶
func (r *ProjectRegistry) Save() error
Save saves the project registry to disk
type UpdateCheckState ¶ added in v0.1.1
type UpdateCheckState struct {
LastCheck time.Time `json:"last_check"`
LastNotifiedVersion string `json:"last_notified_version,omitempty"`
}
UpdateCheckState stores the last update check information
func LoadUpdateCheckState ¶ added in v0.1.1
func LoadUpdateCheckState() (*UpdateCheckState, error)
LoadUpdateCheckState loads the update check state from disk