import ( "github.com/juju/juju/environs/configstore" "github.com/juju/juju/environs/configstore/simplekv" ) func main() { store := simplekv.New() err := store.Put("key1", []byte("value1")) if err != nil { // handle error } value, err := store.Get("key1") if err != nil { // handle error } fmt.Println(string(value)) // "value1" }
import ( "github.com/juju/juju/environs/configstore" "github.com/juju/juju/environs/configstore/sqlite" ) func main() { store, err := sqlite.New("mydb.sqlite") if err != nil { // handle error } err = store.Put("key2", []byte("value2")) if err != nil { // handle error } value, err := store.Get("key2") if err != nil { // handle error } fmt.Println(string(value)) // "value2" }This example shows how to use the sqlite package to create a new store and store/retrieve a key-value pair. Overall, this package library is used for storing configuration data in Juju and is useful for applications that require persistent storage.