aboutsummaryrefslogtreecommitdiff
path: root/objects
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2018-01-15 07:39:49 +0100
committerLaria Carolin Chabowski <laria@laria.me>2018-01-15 07:39:49 +0100
commit62eef384330f652edd17732240ae0d82685c0914 (patch)
tree1ebf60a5baada7e5bd32c44ed0bafbe264958ca9 /objects
parentfc37a9d8e4e240a8fbf297919490c6df7e676d63 (diff)
downloadpetrific-62eef384330f652edd17732240ae0d82685c0914.tar.gz
petrific-62eef384330f652edd17732240ae0d82685c0914.tar.bz2
petrific-62eef384330f652edd17732240ae0d82685c0914.zip
Add command to restore index of a cloud storage
Diffstat (limited to 'objects')
-rw-r--r--objects/object.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/objects/object.go b/objects/object.go
index f9907f2..08525a9 100644
--- a/objects/object.go
+++ b/objects/object.go
@@ -23,6 +23,15 @@ var AllObjectTypes = []ObjectType{
OTSnapshot,
}
+func (ot ObjectType) IsKnown() bool {
+ for _, t := range AllObjectTypes {
+ if t == ot {
+ return true
+ }
+ }
+ return false
+}
+
// RawObject describes a serialized object plus it's type header. This is the content that will be saved.
// It is serialized as the type (ObjectType), a space byte, the size of the payload in bytes (encoded as decimal ASCII number), a newline ('\n') character and the payload.
// The encoding of the payload depends on the type.