userconfig

package
v1.58.8 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MPL-2.0 Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CLIDocs

func CLIDocs() string

func Keys

func Keys() []string

func MarkdownDocs

func MarkdownDocs() string

func RenderOneof

func RenderOneof(oneof []any) string

func RenderValue

func RenderValue(v any) string

func SetForApp

func SetForApp(appRoot, key, value string) error

func SetGlobal

func SetGlobal(key, value string) error

Types

type Cached

type Cached = goldfish.Cache[*Config]

func ForApp

func ForApp(appRoot string) *Cached

func Global

func Global() *Cached

type Config

type Config struct {
	// Whether to open the Local Development Dashboard in the browser on `encore run`.
	// If set to "auto", the browser will be opened if the dashboard is not already open.
	RunBrowser string `koanf:"run.browser" oneof:"always,never,auto" default:"auto"`

	// Always choose this tool when creating an app or when initializing llm tools
	// for an existing app, unless overriden via --llm-rules flag on command line.
	LLMRules string `koanf:"llm_rules" oneof:",cursor,claudecode,vscode,agentsmd,zed" default:""`
}

Config describes the configuration structure we support.

func (*Config) GetByKey

func (c *Config) GetByKey(key string) (v Value, ok bool)

func (*Config) Render

func (c *Config) Render() string

type Kind

type Kind int
const (
	String Kind = iota + 1
	Bool
	Int
	Uint
)

func KindOf

func KindOf[T interface{ string | bool | int | uint }](val T) (k Kind, ok bool)

func (Kind) HumanString

func (k Kind) HumanString() string

func (Kind) String

func (k Kind) String() string

type Type

type Type struct {
	Kind    Kind
	Default *any  // nil means no default
	Oneof   []any // nil means no restrictions
}

func GetType

func GetType(key string) (Type, bool)

func (Type) ParseAndValidate

func (t Type) ParseAndValidate(val string) (any, error)

type Value

type Value struct {
	Val  any
	Type Type
}

func (Value) String

func (v Value) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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