Compare commits

..

2 Commits

Author SHA1 Message Date
e489a12a28 I didnt save the file :P 2024-08-22 19:55:10 -04:00
06a593df25 Add warning about disk writes/reads to Config 2024-08-22 19:54:05 -04:00

View File

@ -54,11 +54,15 @@ type Config interface {
// not a boolean, it will return fallback. // not a boolean, it will return fallback.
GetBool (key string, fallback bool) (bool, error) GetBool (key string, fallback bool) (bool, error)
// Set sets a value in the user-level config file. If the key is // Set sets a value in the user-level config file. If the key is
// invalid, it returns ErrMalformedKey. // invalid, it returns ErrMalformedKey. Note that calling this behavior
// *will* cause a write to disk, and a read from disk for whatever is
// watching the user file.
Set (key string, value Value) error Set (key string, value Value) error
// Reset removes the value from the user-level config file, resetting it // Reset removes the value from the user-level config file, resetting it
// to what is described by the system-level config files. If the key is // to what is described by the system-level config files. If the key is
// invalid, it returns ErrMalformedKey. // invalid, it returns ErrMalformedKey. Note that calling this behavior
// *will* cause a write to disk if successful , and a read from disk for
// whatever is watching the user file.
Reset (key string) error Reset (key string) error
// OnChange specifies a function to be called whenever a value is // OnChange specifies a function to be called whenever a value is
// changed. The callback is always run within the backend's event loop // changed. The callback is always run within the backend's event loop