forked from jjneely/buckytools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuckytools.go
More file actions
43 lines (37 loc) · 951 Bytes
/
Copy pathbuckytools.go
File metadata and controls
43 lines (37 loc) · 951 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
package buckytools
import (
"encoding/json"
)
const (
// Buckytools suite version
Version = "0.1.9"
)
// SupportedHashTypes is the string identifiers of the hashing algorithms
// used for the consistent hash ring. This slice must be sorted.
var SupportedHashTypes = []string{
"carbon",
"jump_fnv1a",
}
// MetricStatType A JSON marshalable FileInfo type
type MetricStatType struct {
Name string // Filename
Size int64 // file size
Mode uint32 // mode bits
ModTime int64 // Unix time
}
// JSONRingType is a datastructure that identifies the name of the server
// buckdy is running on and contains a slice of nodes which are
// "server:instance" (where ":instance" is optional) formatted strings
type JSONRingType struct {
Name string
Nodes []string
Algo string
Replicas int
}
func (j *JSONRingType) String() string {
blob, err := json.Marshal(j)
if err != nil {
return err.Error()
}
return string(blob)
}