Documentation
¶
Index ¶
- Constants
- Variables
- func ApplyPlatformDefaults(cfg *Config, platform system.Platform)
- func CockpitHelperDescriptionForConfig(cfg Config) string
- func CockpitHelperDescriptionForPlatform(platform system.Platform) string
- func CockpitInstallDescriptionForConfig(cfg Config) string
- func CockpitInstallDescriptionForPlatform(platform system.Platform) string
- func CockpitInstallEnableReasonForConfig(cfg Config) string
- func CockpitInstallEnableReasonForPlatform(platform system.Platform) string
- func ComposePath(cfg Config) string
- func ConfigDirPath() (string, error)
- func ConfigFilePath() (string, error)
- func ConfigFilePathForStack(name string) (string, error)
- func ConfigStacksDirPath() (string, error)
- func CurrentCockpitHelperDescription() string
- func CurrentCockpitInstallDescription() string
- func CurrentPackageManagerFieldDescription() string
- func CurrentStackName() (string, error)
- func CurrentStackPath() (string, error)
- func DataDirPath() (string, error)
- func DefaultManagedStackDir() string
- func KnownConfigPaths() ([]string, error)
- func ManagedStackDir(stackName string) (string, error)
- func ManagedStackNeedsScaffold(cfg Config) (bool, error)
- func ManagedStacksDirPath() (string, error)
- func Marshal(cfg Config) ([]byte, error)
- func NATSConfigPath(cfg Config) string
- func NormalizeCockpitSettings(cfg *Config)
- func NormalizeCockpitSettingsForPlatform(cfg *Config, platform system.Platform)
- func PGPassPath(cfg Config) string
- func PackageManagerFieldDescriptionForConfig(cfg Config) string
- func PackageManagerFieldDescriptionForPlatform(platform system.Platform) string
- func PgAdminServersPath(cfg Config) string
- func PromptYesNo(in io.Reader, out io.Writer, question string, defaultYes bool) (bool, error)
- func RedisACLPath(cfg Config) string
- func ResolveSelectedStackName() (string, error)
- func Save(path string, cfg Config) error
- func SelectedStackName() string
- func SetCurrentStackName(name string) error
- func ValidateOrError(cfg Config) error
- func ValidateStackName(name string) error
- type BehaviorConfig
- type Config
- func (c *Config) ApplyDerivedFields()
- func (c Config) CockpitEnabled() bool
- func (c Config) EnabledStackServiceCount() int
- func (c Config) MeilisearchEnabled() bool
- func (c Config) NATSEnabled() bool
- func (c Config) PgAdminBootstrapEnabled() bool
- func (c Config) PgAdminEnabled() bool
- func (c Config) PostgresEnabled() bool
- func (c Config) RedisACLEnabled() bool
- func (c Config) RedisEnabled() bool
- func (c Config) SeaweedFSEnabled() bool
- type ConnectionConfig
- type MeilisearchServiceConfig
- type NATSServiceConfig
- type PgAdminServiceConfig
- type PortsConfig
- type PostgresServiceConfig
- type RedisServiceConfig
- type ScaffoldResult
- type SeaweedFSServiceConfig
- type ServicesConfig
- type SetupConfig
- type StackConfig
- type SystemConfig
- type TUIConfig
- type URLsConfig
- type ValidationError
- type ValidationIssue
Constants ¶
View Source
const ( CurrentSchemaVersion = 1 DefaultTUIAutoRefreshIntervalSeconds = 30 )
View Source
const ( DefaultStackName = "dev-stack" DefaultComposeFileName = "compose.yaml" DefaultNATSConfigName = "nats.conf" DefaultRedisACLName = "redis.acl" DefaultPgAdminServers = "pgadmin-servers.json" DefaultPGPassName = "pgpass" StackNameEnvVar = "STACKCTL_STACK" CurrentStackFileName = "current-stack" )
Variables ¶
View Source
var ErrNotFound = errors.New("stackctl config not found")
Functions ¶
func ApplyPlatformDefaults ¶
func ComposePath ¶
func ConfigDirPath ¶
func ConfigFilePath ¶
func ConfigFilePathForStack ¶
func ConfigStacksDirPath ¶
func CurrentCockpitHelperDescription ¶
func CurrentCockpitHelperDescription() string
func CurrentCockpitInstallDescription ¶
func CurrentCockpitInstallDescription() string
func CurrentPackageManagerFieldDescription ¶
func CurrentPackageManagerFieldDescription() string
func CurrentStackName ¶
func CurrentStackPath ¶
func DataDirPath ¶
func DefaultManagedStackDir ¶
func DefaultManagedStackDir() string
func KnownConfigPaths ¶
func ManagedStackDir ¶
func ManagedStacksDirPath ¶
func NATSConfigPath ¶
func NormalizeCockpitSettings ¶
func NormalizeCockpitSettings(cfg *Config)
func PGPassPath ¶
func PgAdminServersPath ¶
func PromptYesNo ¶
func RedisACLPath ¶
func SelectedStackName ¶
func SelectedStackName() string
func SetCurrentStackName ¶
func ValidateOrError ¶
func ValidateStackName ¶
Types ¶
type BehaviorConfig ¶
type Config ¶
type Config struct {
SchemaVersion int `yaml:"schema_version"`
Stack StackConfig `yaml:"stack"`
Services ServicesConfig `yaml:"services"`
Connection ConnectionConfig `yaml:"connection"`
Ports PortsConfig `yaml:"ports"`
URLs URLsConfig `yaml:"urls"`
Behavior BehaviorConfig `yaml:"behavior"`
Setup SetupConfig `yaml:"setup"`
TUI TUIConfig `yaml:"tui"`
System SystemConfig `yaml:"system"`
}
func DefaultForStack ¶
func (*Config) ApplyDerivedFields ¶
func (c *Config) ApplyDerivedFields()
func (Config) CockpitEnabled ¶
func (Config) EnabledStackServiceCount ¶
func (Config) MeilisearchEnabled ¶
func (Config) NATSEnabled ¶
func (Config) PgAdminBootstrapEnabled ¶
func (Config) PgAdminEnabled ¶
func (Config) PostgresEnabled ¶
func (Config) RedisACLEnabled ¶
func (Config) RedisEnabled ¶
func (Config) SeaweedFSEnabled ¶
type ConnectionConfig ¶
type ConnectionConfig struct {
Host string `yaml:"host"`
PostgresDatabase string `yaml:"postgres_database"`
PostgresUsername string `yaml:"postgres_username"`
PostgresPassword string `yaml:"postgres_password"`
RedisPassword string `yaml:"redis_password"`
RedisACLUsername string `yaml:"redis_acl_username"`
RedisACLPassword string `yaml:"redis_acl_password"`
NATSToken string `yaml:"nats_token"`
SeaweedFSAccessKey string `yaml:"seaweedfs_access_key"`
SeaweedFSSecretKey string `yaml:"seaweedfs_secret_key"`
MeilisearchMasterKey string `yaml:"meilisearch_master_key"`
PgAdminEmail string `yaml:"pgadmin_email"`
PgAdminPassword string `yaml:"pgadmin_password"`
}
type NATSServiceConfig ¶
type NATSServiceConfig struct {
Image string `yaml:"image"`
}
type PgAdminServiceConfig ¶
type PgAdminServiceConfig struct {
Image string `yaml:"image"`
DataVolume string `yaml:"data_volume"`
ServerMode bool `yaml:"server_mode"`
BootstrapPostgresServer bool `yaml:"bootstrap_postgres_server"`
BootstrapServerName string `yaml:"bootstrap_server_name"`
BootstrapServerGroup string `yaml:"bootstrap_server_group"`
}
type PortsConfig ¶
type PostgresServiceConfig ¶
type RedisServiceConfig ¶
type ScaffoldResult ¶
type ScaffoldResult struct {
StackDir string
ComposePath string
NATSConfigPath string
RedisACLPath string
PgAdminServersPath string
PGPassPath string
CreatedDir bool
WroteCompose bool
WroteNATSConfig bool
WroteRedisACL bool
WrotePgAdminServers bool
WrotePGPass bool
AlreadyPresent bool
}
func ScaffoldManagedStack ¶
func ScaffoldManagedStack(cfg Config, force bool) (ScaffoldResult, error)
type SeaweedFSServiceConfig ¶
type ServicesConfig ¶
type ServicesConfig struct {
PostgresContainer string `yaml:"postgres_container"`
RedisContainer string `yaml:"redis_container"`
NATSContainer string `yaml:"nats_container"`
SeaweedFSContainer string `yaml:"seaweedfs_container"`
MeilisearchContainer string `yaml:"meilisearch_container"`
PgAdminContainer string `yaml:"pgadmin_container"`
Postgres PostgresServiceConfig `yaml:"postgres"`
Redis RedisServiceConfig `yaml:"redis"`
NATS NATSServiceConfig `yaml:"nats"`
SeaweedFS SeaweedFSServiceConfig `yaml:"seaweedfs"`
Meilisearch MeilisearchServiceConfig `yaml:"meilisearch"`
PgAdmin PgAdminServiceConfig `yaml:"pgadmin"`
}
type SetupConfig ¶
type SetupConfig struct {
IncludePostgres bool `yaml:"include_postgres"`
IncludeRedis bool `yaml:"include_redis"`
IncludeCockpit bool `yaml:"include_cockpit"`
InstallCockpit bool `yaml:"install_cockpit"`
IncludeNATS bool `yaml:"include_nats"`
IncludeSeaweedFS bool `yaml:"include_seaweedfs"`
IncludeMeilisearch bool `yaml:"include_meilisearch"`
IncludePgAdmin bool `yaml:"include_pgadmin"`
ScaffoldDefaultStack bool `yaml:"scaffold_default_stack"`
}
type StackConfig ¶
type SystemConfig ¶
type SystemConfig struct {
PackageManager string `yaml:"package_manager"`
}
type TUIConfig ¶
type TUIConfig struct {
AutoRefreshIntervalSec int `yaml:"auto_refresh_interval_seconds"`
}
type URLsConfig ¶
type ValidationError ¶
type ValidationError struct {
Issues []ValidationIssue
}
func (ValidationError) Error ¶
func (e ValidationError) Error() string
type ValidationIssue ¶
func Validate ¶
func Validate(cfg Config) []ValidationIssue
Click to show internal directories.
Click to hide internal directories.