chunkutil

package
v0.0.0-...-810cf82 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2019 License: MIT Imports: 5 Imported by: 6

Documentation

Overview

Package chunkutil contains helper functions only needed by chunks.Store implementations. Users of a Store don't need this package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleGet

func HandleGet(ctx context.Context, fn Handler, key cas.Key, typ string, level uint8) (*chunks.Chunk, error)

func Hash

func Hash(chunk *chunks.Chunk) cas.Key

Hash hashes the data in a chunk into a cas.Key.

Hash makes sure to never return a Special Key.

func MakeChunk

func MakeChunk(typ string, level uint8, data []byte) *chunks.Chunk

MakeChunk makes a new Chunk of the given description, filling it with content from data.

Types

type Handler

type Handler func(ctx context.Context, key cas.Key, typ string, level uint8) ([]byte, error)

Jump to

Keyboard shortcuts

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