project

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

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

func LoadContext(dir string) (*Context, error)

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

func (c *Context) DopplerProject() string

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 (c *Context) ProjectName() string

func (*Context) RemoveServiceConfig

func (c *Context) RemoveServiceConfig(name string)

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) RepoOwner

func (c *Context) RepoOwner() string

func (*Context) SecretProvider

func (c *Context) SecretProvider() string

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 (c *Context) UsesDoppler() bool

func (*Context) ValidateConfig

func (c *Context) ValidateConfig() error

type Generator

type Generator interface {
	Init() (string, error)
}

type Project

type Project struct {
	// contains filtered or unexported fields
}

func New

func New(projectName, repoOwner, dir, dopplerProject string) *Project

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) Init

func (p *Project) Init() (string, error)

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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