-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.go
37 lines (32 loc) · 879 Bytes
/
main.go
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
// Package main contains code demonstrating how to use the gosnowth client
// library for various operations.
//
// The examples executable should be run with a space separated list of IRONdb
// servers in the format <host>:<port> as its arguments. It will default to
// using localhost:8112.
package main
import (
"os"
"strings"
)
// SnowthServers contains the IRONdb servers to use when running the examples.
var SnowthServers = []string{"http://localhost:8112"}
func main() {
if len(os.Args) > 1 {
SnowthServers = []string{}
for _, svr := range os.Args[1:] {
if !strings.HasPrefix(svr, "http://") {
svr = "http://" + svr
}
SnowthServers = append(SnowthServers, svr)
}
}
ExampleGetNodeState()
ExampleGetNodeGossip()
ExampleGetTopology()
ExampleSubmitNNT()
ExampleSubmitHistogram()
ExampleReadNNT()
ExampleReadText()
ExampleGetCheckTags()
}