blob

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBlob added in v0.15.5

func NewBlob(r io.Reader) (*Blob, []*Chunk, error)

func WithChunkSize added in v0.14.2

func WithChunkSize(bytes int) func(*manager)

func WithImportWorkers added in v0.14.4

func WithImportWorkers(n 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   []object.Hash
}

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 Chunk

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

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,
	) (*Blob, 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 NewReader added in v0.15.5

func NewReader(chunks []*Chunk) Reader

type Requester added in v0.11.4

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

Jump to

Keyboard shortcuts

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