diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2017-06-25 21:49:04 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2017-06-25 21:49:04 +0200 |
commit | f98b4e4b8165497b64d28d3e54babd1a43ad46d6 (patch) | |
tree | 56f6a34122d46a210d975849c7c599adb924f820 /objects/object_blob.go | |
parent | 1d21280ec755525c6158cd18d01ec4e9ca73d7a0 (diff) | |
download | petrific-f98b4e4b8165497b64d28d3e54babd1a43ad46d6.tar.gz petrific-f98b4e4b8165497b64d28d3e54babd1a43ad46d6.tar.bz2 petrific-f98b4e4b8165497b64d28d3e54babd1a43ad46d6.zip |
File and Blob objects
Diffstat (limited to 'objects/object_blob.go')
-rw-r--r-- | objects/object_blob.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/objects/object_blob.go b/objects/object_blob.go new file mode 100644 index 0000000..c35cb2a --- /dev/null +++ b/objects/object_blob.go @@ -0,0 +1,17 @@ +package objects + +type Blob []byte + +func (b Blob) Type() ObjectType { + return OTBlob +} + +func (b Blob) Payload() []byte { + return []byte(b) +} + +func (b *Blob) FromPayload(bytes []byte) error { + // TODO: perhaps it is better to copy the bytes? + *b = bytes + return nil +} |