storage

package
v0.0.0-...-b9e25f6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const PathChunkLen = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type DirStorage

type DirStorage struct {
	Dir       string
	PathDepth uint8
	DirPerm   os.FileMode
	FilePerm  os.FileMode
}

func (*DirStorage) Check

func (storage *DirStorage) Check(contentHash string) (exists bool, err error)

func (*DirStorage) OpenRead

func (storage *DirStorage) OpenRead(contentHash string, rng *utils.Range) (rc io.ReadCloser, err error)

func (*DirStorage) Write

func (storage *DirStorage) Write(r io.Reader, maxSize int64) (exists bool, contentHash string, size int64, err error)

type Storage

type Storage interface {
	OpenRead(contentHash string, rng *utils.Range) (rc io.ReadCloser, err error)
	Write(r io.Reader, maxSize int64) (exists bool, contentHash string, size int64, err error)
	Check(contentHash string) (exists bool, err error)
}

Jump to

Keyboard shortcuts

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