-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoc.go
More file actions
45 lines (29 loc) · 803 Bytes
/
doc.go
File metadata and controls
45 lines (29 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Package jsonstore is a client for the https://www.jsonstore.io API
Installation
go get -u github.com/peterhellberg/jsonstore
Usage
package main
import (
"context"
"fmt"
"github.com/peterhellberg/jsonstore"
)
const secret = "3ba7860f742fc15d5b6e1508e2de1e0cde2c396f7c52a877905befb4e970eaaf"
type example struct {
Number int
Bool bool
String string
}
func main() {
ctx := context.Background()
store := jsonstore.New(jsonstore.Secret(secret))
store.Post(ctx, "key", example{1234, true, "initial"})
store.Put(ctx, "key/String", "modified")
store.Delete(ctx, "key/Bool")
var e example
store.Get(ctx, "key", &e)
fmt.Printf("%s -> %+v\n", store.URL("key"), e)
}
*/
package jsonstore