store

package
v0.0.0-...-284e23e Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2018 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk interface {
	ID() ChunkID
	Path() ChunkPath
	Write(b []byte, offset int64) (int, error)
	Read(len int, offset int64) ([]byte, int, error)
	Delete() error
	Close()
}

func NewChunk

func NewChunk(id ChunkID, dir string) (Chunk, error)

type ChunkID

type ChunkID uint64

type ChunkPath

type ChunkPath string

type Store

type Store interface {
	CreateChunk(id ChunkID) error
	ListChunks() []ChunkID
	GetChunk(id ChunkID) (Chunk, error)
	ChunkExists(id ChunkID) bool
	LoadChunks() error
	Close()
}

func NewDiskStore

func NewDiskStore(dirPath string) (Store, error)

Jump to

Keyboard shortcuts

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