blob

package
v0.18.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 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
	Chunks   []object.CID
}

func (*Blob) FromObject

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

func (*Blob) MarshalMap added in v0.18.0

func (e *Blob) MarshalMap() (object.Map, error)

func (*Blob) MarshalObject added in v0.18.0

func (e *Blob) MarshalObject() (*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

func (*Blob) UnmarshalMap added in v0.18.0

func (e *Blob) UnmarshalMap(m object.Map) error

func (*Blob) UnmarshalObject added in v0.18.0

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

type Chunk

type Chunk struct {
	Metadata object.Metadata
	Data     []byte
}

func (*Chunk) FromObject

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

func (*Chunk) MarshalMap added in v0.18.0

func (e *Chunk) MarshalMap() (object.Map, error)

func (*Chunk) MarshalObject added in v0.18.0

func (e *Chunk) MarshalObject() (*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

func (*Chunk) UnmarshalMap added in v0.18.0

func (e *Chunk) UnmarshalMap(m object.Map) error

func (*Chunk) UnmarshalObject added in v0.18.0

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

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,
		cid object.CID,
	) (*Blob, []*Chunk, error)
}

Jump to

Keyboard shortcuts

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