Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.0.113 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfigNotFound = errors.New("c2j config not found")
)

Functions

func DiscoverConfigPath

func DiscoverConfigPath(startDir string) (string, error)

func RenderInitConfigTemplate

func RenderInitConfigTemplate(ctx context.Context, rootDir string) ([]byte, error)

Types

type CellRefConfig

type CellRefConfig struct {
	Repo StringOrCommand `yaml:"repo"`
	Ref  StringOrCommand `yaml:"ref"`
}

type DependentEdit added in v0.0.86

type DependentEdit struct {
	Path    string
	Repo    string
	Status  string
	YAML    []byte
	Changed bool
	// contains filtered or unexported fields
}

DependentEdit is a validated config edit. Preparing it never writes files.

func PrepareDependentEdit added in v0.0.86

func PrepareDependentEdit(ctx context.Context, startDir, value string, description *string) (*DependentEdit, error)

PrepareDependentEdit adds or updates a manual entry. A nil description leaves existing metadata alone; a pointer to an empty string clears it.

func (*DependentEdit) Write added in v0.0.86

func (e *DependentEdit) Write() error

Write atomically replaces the config, rejecting detected intervening changes. The last check is optimistic concurrency detection, not cross-process locking.

type DependentEntry added in v0.0.86

type DependentEntry struct {
	Repo        string `yaml:"repo"`
	Description string `yaml:"description,omitempty"`
}

DependentEntry describes a repository in the dependent cell set.

type DependentsConfig

type DependentsConfig struct {
	Repos   []string // Repository projection of Entries, retained for repo-only callers.
	Entries []DependentEntry
	Command string `yaml:"command"`
	Filter  string `yaml:"filter"`
	// contains filtered or unexported fields
}

func (*DependentsConfig) UnmarshalYAML

func (d *DependentsConfig) UnmarshalYAML(node *yaml.Node) error

type PackageList added in v0.0.108

type PackageList []string

PackageList uses the same literal references as recipe execution.packages. Project declarations must be portable: installation does not run in the repo.

func (*PackageList) UnmarshalYAML added in v0.0.108

func (p *PackageList) UnmarshalYAML(n *yaml.Node) error

type PackageSource added in v0.0.108

type PackageSource struct {
	Path     string   `json:"path"`
	Digest   string   `json:"digest,omitempty"`
	Missing  bool     `json:"missing,omitempty"`
	Packages []string `json:"packages,omitempty"`
}

PackageSource is provenance, not a resolved package lock or a full config.

func LoadWorkspacePackages added in v0.0.108

func LoadWorkspacePackages(workspace string) (source PackageSource, err error)

LoadWorkspacePackages reads only the exact restored workspace's config. It never searches ancestors, auto-detects a project, or resolves config commands.

type ProjectConfig

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

func LoadProjectConfig

func LoadProjectConfig(startDir string) (*ProjectConfig, error)

func (*ProjectConfig) AllowedCells

func (c *ProjectConfig) AllowedCells(ctx context.Context) ([]string, error)

func (*ProjectConfig) AllowedDependentEntries added in v0.0.86

func (c *ProjectConfig) AllowedDependentEntries(ctx context.Context) ([]DependentEntry, error)

AllowedDependentEntries applies discovery filters while retaining metadata.

func (*ProjectConfig) AllowedDependentRepos

func (c *ProjectConfig) AllowedDependentRepos(ctx context.Context) ([]string, error)

func (*ProjectConfig) CanSubmitToCell

func (c *ProjectConfig) CanSubmitToCell(ctx context.Context, value string) (bool, error)

func (*ProjectConfig) CanonicalRepo

func (c *ProjectConfig) CanonicalRepo(ctx context.Context) (string, error)

func (*ProjectConfig) CellNameFromRepo

func (c *ProjectConfig) CellNameFromRepo(ctx context.Context, repo string) (string, bool)

func (*ProjectConfig) CellResolution added in v0.0.54

func (c *ProjectConfig) CellResolution(ctx context.Context) (*cellref.Context, error)

CellResolution captures effective settings; workers never execute config commands.

func (*ProjectConfig) DefaultRef

func (c *ProjectConfig) DefaultRef(ctx context.Context) (string, error)

func (*ProjectConfig) DependentCells

func (c *ProjectConfig) DependentCells(ctx context.Context) ([]string, error)

func (*ProjectConfig) DependentEntries added in v0.0.86

func (c *ProjectConfig) DependentEntries(ctx context.Context) ([]DependentEntry, error)

DependentEntries resolves descriptions with their repository locations.

func (*ProjectConfig) DependentRepos

func (c *ProjectConfig) DependentRepos(ctx context.Context) ([]string, error)

DependentRepos projects repository locations from the resolved entries.

func (*ProjectConfig) ExpandCellName

func (c *ProjectConfig) ExpandCellName(ctx context.Context, value string) (string, error)

func (*ProjectConfig) JobDBURI added in v0.0.42

func (c *ProjectConfig) JobDBURI(ctx context.Context) (string, error)

func (*ProjectConfig) Packages added in v0.0.108

func (c *ProjectConfig) Packages() []string

func (*ProjectConfig) Path

func (c *ProjectConfig) Path() string

func (*ProjectConfig) Pattern

func (c *ProjectConfig) Pattern(ctx context.Context) (string, error)

func (*ProjectConfig) RootCell

func (c *ProjectConfig) RootCell(ctx context.Context) (string, error)

func (*ProjectConfig) RootDir

func (c *ProjectConfig) RootDir() string

func (*ProjectConfig) RootRef

func (c *ProjectConfig) RootRef(ctx context.Context) (string, error)

func (*ProjectConfig) RootRepo

func (c *ProjectConfig) RootRepo(ctx context.Context) (string, error)

func (*ProjectConfig) SelfRef

func (c *ProjectConfig) SelfRef(ctx context.Context) (string, error)

func (*ProjectConfig) SelfRepo

func (c *ProjectConfig) SelfRepo(ctx context.Context) (string, error)

type SelfConfig added in v0.0.5

type SelfConfig struct {
	Repo StringOrCommand `yaml:"repo"`
	Ref  StringOrCommand `yaml:"ref"`
}

type StringOrCommand

type StringOrCommand struct {
	Value   string
	Command string
}

func (*StringOrCommand) UnmarshalYAML

func (s *StringOrCommand) UnmarshalYAML(node *yaml.Node) error

Jump to

Keyboard shortcuts

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