settings

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 6 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

Overview

Package settings is settings.json in atc's config folder: who the user and the assistant are, and values for atc's ATC_* settings. It fills in the process environment at startup, so everything that reads os.Getenv keeps working and a variable set in the real environment always wins.

Index

Constants

View Source
const (
	AutonomyKey     = "ATC_ASSISTANT_AUTONOMY"
	AutonomyLimited = "limited"
	AutonomyDaily   = "daily"
	AutonomyFull    = "full"
)

AutonomyKey is how much the assistant may do with nobody to approve it. Empty is AutonomyDaily.

View Source
const LanguageKey = "ATC_STT_LANGUAGE"

Variables

Functions

func EnvFile

func EnvFile(path string)

EnvFile fills in the variables a KEY=value file sets, for a command that runs outside the service that file is written for.

Types

type File

type File struct {
	User      string            `json:"user,omitempty"`
	Assistant string            `json:"assistant,omitempty"`
	Language  string            `json:"language,omitempty"`
	Env       map[string]string `json:"env,omitempty"`
}

type Settings

type Settings struct {
	Dir string
	// contains filtered or unexported fields
}

Settings remembers what this process started with, which is what tells a value that needs a restart.

func Apply

func Apply(dir string) (*Settings, error)

Apply puts settings.json's values into the environment for the variables that are not set there. It reports a file it could not read; the rest of atc then runs as if there were none.

func (*Settings) IdentityChanged

func (s *Settings) IdentityChanged(f File) bool

IdentityChanged says whether the names or language differ from what this process started with.

func (*Settings) Load

func (s *Settings) Load() (File, error)

func (*Settings) Path

func (s *Settings) Path() string

func (*Settings) Pending

func (s *Settings) Pending(f File) []string

Pending lists the keys whose value in the file differs from what this process runs with.

func (*Settings) Save

func (s *Settings) Save(f File) error

func (*Settings) Source

func (s *Settings) Source(f File, key string) string

Source says where Value comes from: "env", "settings" or "" for not set.

func (*Settings) Value

func (s *Settings) Value(f File, key string) string

Value is a setting as atc will have it after a restart: the environment's if it sets one, else the file's.

Jump to

Keyboard shortcuts

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