aboutsummaryrefslogtreecommitdiff
path: root/object/store/dual/writer.go
blob: f75f49e11beca13447f5947d125057b5ac892461 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package dual

import (
	"io"

	"lindenii.org/go/furgit/object/id"
	"lindenii.org/go/furgit/object/store"
	"lindenii.org/go/furgit/object/typ"
)

// WriteBytesFull writes one full serialized object to the object side.
func (dual *Dual) WriteBytesFull(raw []byte) (id.ObjectID, error) {
	return dual.object.WriteBytesFull(raw) //nolint:wrapcheck
}

// WriteBytesContent writes one typed object content byte slice to the object side.
func (dual *Dual) WriteBytesContent(ty typ.Type, content []byte) (id.ObjectID, error) {
	return dual.object.WriteBytesContent(ty, content) //nolint:wrapcheck
}

// WriteReaderFull writes one full serialized object stream to the object side.
func (dual *Dual) WriteReaderFull(src io.Reader) (id.ObjectID, error) {
	return dual.object.WriteReaderFull(src) //nolint:wrapcheck
}

// WriteReaderContent writes one typed object content stream to the object side.
func (dual *Dual) WriteReaderContent(ty typ.Type, size int, src io.Reader) (id.ObjectID, error) {
	return dual.object.WriteReaderContent(ty, size, src) //nolint:wrapcheck
}

// WritePack ingests one pack stream into the pack side.
func (dual *Dual) WritePack(src io.Reader, opts store.PackWriteOptions) error {
	return dual.pack.WritePack(src, opts) //nolint:wrapcheck
}