chunk

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = fmt.Errorf("chunk not found")
)

Functions

func Configure

func Configure()

func Create

func Create(ctx context.Context, data []byte) (string, error)

func Delete

func Delete(ctx context.Context, id string) error

func Write

func Write(id string, w io.Writer) error

Types

type Chunk

type Chunk struct {
	ID         string
	Size       uint64
	References uint64
}

type Stats

type Stats struct {
	Count     uint64
	TotalSize uint64
}

func GetStats

func GetStats(ctx context.Context) (Stats, error)

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter() (*Writer, error)

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) Commit

func (w *Writer) Commit(ctx context.Context) (string, error)

Commit commits the writer, resulting in a new chunk being created

func (*Writer) Size

func (w *Writer) Size() int64

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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