Documentation ¶
Overview ¶
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()
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var MaxPoll = time.Minute
MaxPoll limits the maximum poll interval for the PG instance.
This is mostly to make integration tests take less time
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.