config

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindProjectRoot

func FindProjectRoot() (string, error)

FindProjectRoot searches upward from CWD for a directory containing .musing.yaml and loads the project configuration

func GetAPIRepos

func GetAPIRepos() []string

GetAPIRepos returns paths to expected API repositories Dynamically discovers repos relative to project root based on config

func MustFindProjectRoot added in v0.3.2

func MustFindProjectRoot() string

MustFindProjectRoot finds the project root or exits with a helpful error message

Types

type DatabaseConfig

type DatabaseConfig struct {
	Type     string `yaml:"type"` // mongodb, postgres, etc
	Name     string `yaml:"name"` // Database name
	DevPort  int    `yaml:"devPort"`
	ProdPort int    `yaml:"prodPort"`
	DataDir  string `yaml:"dataDir"` // Relative path to data directory
}

DatabaseConfig represents database configuration

type ProductionConfig

type ProductionConfig struct {
	Server       string `yaml:"server"`       // SSH server (e.g., "root@your-server.com")
	RemoteDBPort int    `yaml:"remoteDBPort"` // Remote database port (typically same as devPort)
	SSHKeyPath   string `yaml:"sshKeyPath"`   // Optional SSH key path (e.g., "~/.ssh/digital-ocean/id_ed25519")
}

ProductionConfig represents optional production deployment settings

type ProjectConfig

type ProjectConfig struct {
	Services    []ServiceConfig   `yaml:"services"`
	Database    DatabaseConfig    `yaml:"database"`
	Production  *ProductionConfig `yaml:"production,omitempty"`  // Optional production config
	APIReposDir string            `yaml:"apiReposDir,omitempty"` // Optional. Directory holding API repos. Relative paths resolve against the project root's parent. Absolute and ~-prefixed paths are honored as-is. Defaults to the project root's parent (sibling layout).
}

ProjectConfig represents the .musing.yaml configuration

func GetConfig

func GetConfig() *ProjectConfig

GetConfig returns the loaded project configuration

type ServiceConfig

type ServiceConfig struct {
	Name       string `yaml:"name"`
	Port       int    `yaml:"port"`
	Type       string `yaml:"type"`                 // frontend, api, database
	Alias      string `yaml:"alias,omitempty"`      // Optional: short CLI name for `musing deploy`. Falls back to data file key when omitted.
	Collection string `yaml:"collection,omitempty"` // Optional: data file key (filename without .json). When omitted, defaults to Alias.
}

ServiceConfig represents a service in the stack

Jump to

Keyboard shortcuts

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