A Golang Library uses Github Gists as a simple NoSQL database
A Golang Library uses Github Gists as a simple NoSQL database, mainly for low-traffic logging purposes.
Each Gist created can have multiple files. So think in the gist as a Database, and in the file inside the gist as a Table.
Gists API calls are restricted by rate-limiting, you need to be aware of that.
log := gistlog.NewLog("<PUT GIST ID HERE>", "<PUT VALID GITHUB TOKEN HERE>")
//Inserting data into a new/existing file in the specified gist id above
err := log.Insert("aNewFileInTheGist", []string{
"val1",
"val2",
"val3",
})
fmt.Println(err)
// Inserting data asynchronously into a new/existing file in the specified gist id above, in such case errors are ignored
log.InsertAsync("yetAnotherNewFile", []string{
"val1",
"val2",
"val3",
})
// Read data from gist by filename, return a slice of slices
fmt.Println(log.Read("aNewFileInTheGist"))