Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 542 Bytes

README.md

File metadata and controls

35 lines (28 loc) · 542 Bytes

persist

A key-value pair storage for simple use cases, used to store premitive values.

Example:

package main

import (
  "fmt"
  
  "github.com/msal4/persist"
)

func main() {
	// Create a new Store
	s := persist.NewStore("mydb.db")
	// Open db file
	persist.Must(s.Open())
	// Always close the file
	defer s.Close()
	// Store a value with the key "key"
	if err := s.Put("key", "value"); err != nil {
		fmt.Println(err)
	}
	// Get the value
	v, _ := s.Get("key")
	fmt.Println(v) // Output: value
}

Note:

Don't use it.