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
- Variables
- func EnvFile(path string)
- type File
- type Settings
- func (s *Settings) IdentityChanged(f File) bool
- func (s *Settings) Load() (File, error)
- func (s *Settings) Path() string
- func (s *Settings) Pending(f File) []string
- func (s *Settings) Save(f File) error
- func (s *Settings) Source(f File, key string) string
- func (s *Settings) Value(f File, key string) string
Constants ¶
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.
const LanguageKey = "ATC_STT_LANGUAGE"
Variables ¶
var AutonomyLevels = []string{AutonomyLimited, AutonomyDaily, AutonomyFull}
Functions ¶
Types ¶
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 ¶
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 ¶
IdentityChanged says whether the names or language differ from what this process started with.
func (*Settings) Pending ¶
Pending lists the keys whose value in the file differs from what this process runs with.