config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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

func GetProjectConfigDir(projectPath string) string

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

func GetUpdateCheckPath() (string, error)

GetUpdateCheckPath returns the path to the update check state file

func SaveConfig

func SaveConfig(cfg *Config) error

func SaveUpdateCheckState added in v0.1.1

func SaveUpdateCheckState(state *UpdateCheckState) error

SaveUpdateCheckState saves the update check state to disk

func SetConfigValue

func SetConfigValue(key string, value interface{}) error

func ShouldCheckForUpdates added in v0.1.1

func ShouldCheckForUpdates(lastCheck time.Time, interval time.Duration) bool

ShouldCheckForUpdates determines if we should check for updates based on interval

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

func GetProjectConfig(projectPath string) (*Config, error)

GetProjectConfig loads the config for a specific project

func LoadConfig

func LoadConfig() (*Config, error)

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

type ProjectRegistry struct {
	Projects map[string]*Project `json:"projects"`
}

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

Jump to

Keyboard shortcuts

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