diff --git a/vendor/github.com/hashicorp/consul/consul/structs/snapshot.go b/vendor/github.com/hashicorp/consul/consul/structs/snapshot.go new file mode 100644 index 000000000..3d65e317f --- /dev/null +++ b/vendor/github.com/hashicorp/consul/consul/structs/snapshot.go @@ -0,0 +1,40 @@ +package structs + +type SnapshotOp int + +const ( + SnapshotSave SnapshotOp = iota + SnapshotRestore +) + +// SnapshotRequest is used as a header for a snapshot RPC request. This will +// precede any streaming data that's part of the request and is JSON-encoded on +// the wire. +type SnapshotRequest struct { + // Datacenter is the target datacenter for this request. The request + // will be forwarded if necessary. + Datacenter string + + // Token is the ACL token to use for the operation. If ACLs are enabled + // then all operations require a management token. + Token string + + // If set, any follower can service the request. Results may be + // arbitrarily stale. Only applies to SnapshotSave. + AllowStale bool + + // Op is the operation code for the RPC. + Op SnapshotOp +} + +// SnapshotResponse is used header for a snapshot RPC response. This will +// precede any streaming data that's part of the request and is JSON-encoded on +// the wire. +type SnapshotResponse struct { + // Error is the overall error status of the RPC request. + Error string + + // QueryMeta has freshness information about the server that handled the + // request. It is only filled in for a SnapshotSave. + QueryMeta +} diff --git a/vendor/github.com/hashicorp/consul/lib/path.go b/vendor/github.com/hashicorp/consul/lib/path.go new file mode 100644 index 000000000..8c959a72f --- /dev/null +++ b/vendor/github.com/hashicorp/consul/lib/path.go @@ -0,0 +1,14 @@ +package lib + +import ( + "os" + "path/filepath" +) + +// EnsurePath is used to make sure a path exists +func EnsurePath(path string, dir bool) error { + if !dir { + path = filepath.Dir(path) + } + return os.MkdirAll(path, 0755) +} diff --git a/vendor/github.com/hashicorp/consul/types/node_id.go b/vendor/github.com/hashicorp/consul/types/node_id.go new file mode 100644 index 000000000..c0588ed42 --- /dev/null +++ b/vendor/github.com/hashicorp/consul/types/node_id.go @@ -0,0 +1,4 @@ +package types + +// NodeID is a unique identifier for a node across space and time. +type NodeID string