1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 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 }