config

package
v0.1.0-dev.20260814001600 Latest Latest
Warning

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

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

Documentation

Overview

Package config provides configuration management operations for the star runtime.

Index

Constants

This section is empty.

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

+devlore:access=immediate

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