bucket

package
v0.0.0-...-8b2a550 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2013 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StoreBlock

func StoreBlock(b Bucket, block []byte) (hash []byte, err error)

Store takes a block and stores it in the Bucket using a Sha1-Hash as key, wich is returned

Types

type Bucket

type Bucket interface {
	Store(hash, block []byte) error
	Load(hash []byte) ([]byte, error)

	// Efficient Load without block allocation
	ELoad(hash, block []byte) error

	// Efficient Testing whether a block to that given hash exists
	Exists(hash []byte) bool

	// Lists the Hashes and pushes it in the given channel
	// it shall not close() the channel
	ListUp(hashes chan<- []byte)
}

type FsBucket

type FsBucket string

func (FsBucket) ELoad

func (fb FsBucket) ELoad(hash, block []byte) error

func (FsBucket) Exists

func (fb FsBucket) Exists(hash []byte) bool

func (FsBucket) ListUp

func (fb FsBucket) ListUp(hashes chan<- []byte)

func (FsBucket) Load

func (fb FsBucket) Load(hash []byte) ([]byte, error)

func (FsBucket) Name

func (fb FsBucket) Name(hash []byte) string

func (FsBucket) Store

func (fb FsBucket) Store(hash, block []byte) error

Jump to

Keyboard shortcuts

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