blob

package
v0.14.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithChunkSize added in v0.14.2

func WithChunkSize(bytes int) func(*manager)

func WithObjectManager added in v0.11.4

func WithObjectManager(x objectmanager.ObjectManager) func(*manager)

func WithResolver added in v0.11.4

func WithResolver(res resolver.Resolver) func(*manager)

Types

type Blob

type Blob struct {
	Metadata object.Metadata `nimona:"metadata:m,omitempty"`
	Chunks   []*Chunk        `nimona:"chunks:ao,omitempty"`
}

func ToBlob

func ToBlob(r io.Reader) (*Blob, error)

func (*Blob) FromObject

func (e *Blob) FromObject(o *object.Object) error

func (Blob) ToObject

func (e Blob) ToObject() *object.Object

func (*Blob) Type added in v0.12.0

func (e *Blob) Type() string

type BlobUnloaded added in v0.13.0

type BlobUnloaded struct {
	Metadata       object.Metadata `nimona:"metadata:m,omitempty"`
	ChunksUnloaded []object.Hash   `nimona:"chunks:ar,omitempty"`
}

nolint: golint // stuttering is fine for this one

func (*BlobUnloaded) FromObject added in v0.13.0

func (e *BlobUnloaded) FromObject(o *object.Object) error

func (BlobUnloaded) ToObject added in v0.13.0

func (e BlobUnloaded) ToObject() *object.Object

func (*BlobUnloaded) Type added in v0.13.0

func (e *BlobUnloaded) Type() string

type Chunk

type Chunk struct {
	Metadata object.Metadata `nimona:"metadata:m,omitempty"`
	Data     []byte          `nimona:"data:d,omitempty"`
}

func (*Chunk) FromObject

func (e *Chunk) FromObject(o *object.Object) error

func (Chunk) ToObject

func (e Chunk) ToObject() *object.Object

func (*Chunk) Type added in v0.12.0

func (e *Chunk) Type() string

type Manager added in v0.14.2

type Manager interface {
	Requester
	ImportFromFile(
		ctx context.Context,
		inputPath string,
	) (*BlobUnloaded, error)
}

func NewManager added in v0.14.2

func NewManager(
	ctx context.Context,
	opts ...Option,
) Manager

type Option added in v0.11.4

type Option func(*manager)

type Reader

type Reader interface {
	Read(p []byte) (n int, err error)
}

func FromBlob

func FromBlob(bl *Blob) Reader

type Requester added in v0.11.4

type Requester interface {
	Request(
		ctx context.Context,
		hash object.Hash,
	) (*Blob, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL