aboutsummaryrefslogtreecommitdiff
path: root/objects/object_blob.go
blob: a6b3f7bb1d5bc958f1deb379ce13ab8b856492db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package objects

// Blob is an object containing raw bytes. It's serialized payload is just that content.
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
}