diff options
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 +} |