config

package
v0.1.0-dev.20260904020137 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package config provides configuration management operations for the star runtime.

Index

Constants

View Source
const (
	Get  op.ActionName = "config.get"
	Show op.ActionName = "config.show"
	Sync op.ActionName = "config.sync"
)

Action-name constants for the config provider's plan-mode actions.

Each constant is the short dotted action label its method dispatches under. Pass these to plan.Plan, op.ReceiverRegistry().BuildAction, RuntimeEnvironment.ActionByName, or WithActionNamed in place of a string literal so a typo is a compile error and rename / find-references work through the constant.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	op.ProviderBase
}

Provider provides configuration operations: get (merged config), show (config with sources), and sync (write tool-specific config files).

func NewProvider

func NewProvider(ctx *op.RuntimeEnvironment) *Provider

NewProvider creates a config provider bound to the given context. Declares interest in the "config" variable so the resolver populates it from the [application.Application]'s source maps at construction time.

func (*Provider) Get

func (p *Provider) Get() (any, error)

Get returns the merged configuration from the hierarchy as a Starlark struct with attribute access (e.g., cfg.lint.copyright.enabled).

Returns:

  • any: the config as a Starlark value
  • error: if config loading fails

+devlore:property

func (*Provider) Show

func (p *Provider) Show() (ShowResult, error)

Show returns the config with source file information.

Returns:

  • ShowResult: config value and list of source files
  • error: if config loading fails

func (*Provider) Sync

func (p *Provider) Sync() (SyncResult, error)

Sync writes tool-specific config files from star/config.yaml.

Returns:

  • SyncResult: paths of generated files and count
  • error: if config loading or sync fails

type ShowResult

type ShowResult struct {
	Config  any          `starlark:"config"`
	Sources []SourceInfo `starlark:"sources"`
}

ShowResult holds config with source information.

type SourceInfo

type SourceInfo struct {
	Path   string `starlark:"path"`
	Exists bool   `starlark:"exists"`
}

SourceInfo represents a config source file and whether it exists.

type SyncResult

type SyncResult struct {
	GolangciLint   string `starlark:"golangci_lint"`
	MarkdownLint   string `starlark:"markdown_lint"`
	FilesGenerated int    `starlark:"files_generated"`
}

SyncResult holds the outcome of a config sync.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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