package
0.0.0-20190930002912-917641f8ea70
Repository: https://github.com/dotchain/dot.git
Documentation: pkg.go.dev
# Packages
Package bolt implements the dot storage for files using boltdb
A http server can be implemented like so: import "github.com/dotchain/dot/ops/bolt" import "github.com/dotchain/dot/ops/nw" store, _ := bolt.New("file.bolt", "instance", nil) defer store.Close() handler := &nw.Handler{Store: store} h := func(w http.ResponseWriter, req *http.Request) { // Enable CORS w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Headers", "Content-Type") if req.Method == "OPTIONS" { return } handler.ServeHTTP(w, req) } http.HandleFunc("/api/", h) http.ListenAndServe()
Concurrency
A single store instance is safe for concurrent access but the provided file is locked until the store is closed.
No description provided by the author
Package pg implements the dot storage for postgres 9.5+
A http server can be implemented like so: import "github.com/dotchain/dot/ops/pg" import "github.com/dotchain/dot/ops/nw" dataSource := "dbname=mydb user=xyz" store, _ := sql.New(dataSource, "instance", nil) defer store.Close() handler := &nw.Handler{Store: store} h := func(w http.ResponseWriter, req *http.Request) { // Enable CORS w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Headers", "Content-Type") if req.Method == "OPTIONS" { return } handler.ServeHTTP(w, req) } http.HandleFunc("/api/", h) http.ListenAndServe()
.
Package sjson implements a portable strongly-typed json-like codec.
No description provided by the author
# Functions
Polled implements a low-latency in memory poller.
Transformed takes a store of raw operations and converts them to a transformed version that can be applied in sequence.