Documentation
¶
Index ¶
- type Context
- func (c *Context) Config() projectcfg.Config
- func (c *Context) DevConfig() projectcfg.DevConfig
- func (c *Context) DopplerProject() string
- func (c *Context) ProjectName() string
- func (c *Context) RemoveServiceConfig(name string)
- func (c *Context) RepoOwner() string
- func (c *Context) SecretProvider() string
- func (c *Context) ServiceConfig(name string) projectcfg.ServiceConfig
- func (c *Context) SetServiceConfig(name string, sc projectcfg.ServiceConfig)
- func (c *Context) UsesDoppler() bool
- func (c *Context) ValidateConfig() error
- type Generator
- type Project
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
RootPath string
// contains filtered or unexported fields
}
Context is a read-only handle on an already-initialised project. It is loaded from disk via LoadContext; never constructed by hand.
func LoadContext ¶
LoadContext walks up from dir until it finds a project.toml, then loads, validates, and returns the project context. Validation runs at load time so any maestro command (refresh, service, delete, rename, preset, …) fails loudly on a malformed config instead of silently scaffolding around it.
func (*Context) Config ¶
func (c *Context) Config() projectcfg.Config
func (*Context) DevConfig ¶
func (c *Context) DevConfig() projectcfg.DevConfig
func (*Context) DopplerProject ¶
DopplerProject returns the Doppler project the repo is pinned to, falling back to the project name when project.toml does not record one.
func (*Context) ProjectName ¶
func (*Context) RemoveServiceConfig ¶
RemoveServiceConfig drops the per-service entry from the in-memory context — used by Delete so generators called afterward see the service as gone.
func (*Context) SecretProvider ¶
func (*Context) ServiceConfig ¶
func (c *Context) ServiceConfig(name string) projectcfg.ServiceConfig
ServiceConfig returns the per-service settings recorded in project.toml, or a zero value when the service has no entry yet (e.g. legacy projects).
func (*Context) SetServiceConfig ¶
func (c *Context) SetServiceConfig(name string, sc projectcfg.ServiceConfig)
SetServiceConfig mirrors a freshly persisted per-service entry onto the in-memory context so generators that consume the context see the change without a disk round-trip.
func (*Context) UsesDoppler ¶
func (*Context) ValidateConfig ¶
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
func New ¶
New builds a project to be generated at dir. A non-empty dopplerProject switches the project's secrets provider to Doppler and pins it to that Doppler project; an empty value leaves secret management disabled.
func (*Project) WithScaffolds ¶
func (p *Project) WithScaffolds(sc config.ScaffoldConfig) *Project
WithScaffolds overrides the optional-scaffold choices captured by the init wizard. The defaults are opt-in (everything false), so the wizard uses this to turn on the pieces the user agreed to — typically CI and LICENSE — without bloating New's signature with one flag per scaffold.