-
Notifications
You must be signed in to change notification settings - Fork 14
/
constants.go
34 lines (30 loc) · 1.18 KB
/
constants.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
package database
import "errors"
type ctxKey string
const (
// Permissions to use on the db file. This is only used if the
// database file does not exist and needs to be created.
dbFileMode = 0600
changeChannel = "state"
authCtxKey ctxKey = "x-graphik-auth-ctx"
userType ctxKey = "user"
methodCtxKey ctxKey = "x-graphik-full-method"
bypassAuthorizersCtxKey ctxKey = "x-graphik-authorzer-override"
tokenCtxKey ctxKey = "x-graphik-token"
raftSecretMDKey = "x-graphik-raft-secret"
)
var (
DONE = errors.New("DONE")
// Bucket names we perform transactions in
dbConnections = []byte("connections")
dbDocs = []byte("docs")
dbIndexes = []byte("indexes")
dbAuthorizers = []byte("authorizers")
dbTypeValidators = []byte("typeValidators")
dbIndexDocs = []byte("indexedDocs")
dbIndexConnections = []byte("indexedConnections")
// An error indicating a given key does not exist
ErrNotFound = errors.New("not found")
ErrAlreadyExists = errors.New("already exists")
ErrUnsupportedAlgorithm = errors.New("unsupported algorithm")
)