forked from kyma-project/kyma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
driver.go
38 lines (29 loc) · 1017 Bytes
/
driver.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
38
package etcd
import "github.com/coreos/etcd/clientv3"
// TODO list:
// - Use etcd lease for garbage collection of removed elements.
// Create lease on element delete and attach it to each object which should be deleted.
const (
entityNamespaceSeparator = "/"
entityNamespaceBundle = "bundle"
entityNamespaceBundleMappingID = "id"
entityNamespaceBundleMappingNV = "nv"
entityNamespaceChart = "chart"
entityNamespaceInstance = "instance"
entityNamespaceInstanceOperation = "instanceOperation"
entityNamespaceInstanceBindData = "instanceBindData"
)
// Config holds configuration for etcd access in storage.
type Config struct {
Endpoints []string `json:"endpoints"`
Username string `json:"username"`
Password string `json:"password"`
ForceClient *clientv3.Client
}
func entityNamespacePrefixParts() []string {
return []string{"helm-broker", "entity"}
}
// generic is a foundation for all drivers using etcd as storage.
type generic struct {
kv clientv3.KV
}