chunk

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Check added in v0.3.0

func Check() bool

func Configure

func Configure()

func Create

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

func DecreaseReferenceCount added in v0.2.0

func DecreaseReferenceCount(ctx context.Context, chunkId string) error

func Delete

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

func IncreaseReferenceCount added in v0.2.0

func IncreaseReferenceCount(ctx context.Context, chunkId 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