blob

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const BlobType = "nimona.io/Blob"
View Source
const ChunkType = "nimona.io/Chunk"

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,type=nimona.io/Blob"`
	Chunks   []tilde.Digest  `nimona:"chunks:as"`
}

type Chunk

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

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 tilde.Digest,
	) (*Blob, []*Chunk, error)
}

Jump to

Keyboard shortcuts

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