storage

package
v0.0.0-...-58d8038 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TypBlob = iota
	TypTree
	TypRef
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseStorage

type BaseStorage struct {
	// contains filtered or unexported fields
}

func NewBase

func NewBase(hashFunc func() kfscrypto.Hash) BaseStorage

func (*BaseStorage) HashFunc

func (s *BaseStorage) HashFunc() kfscrypto.Hash

type Status

type Status struct {
	TotalPhysicalSize uint64
	BlobLogicalSize   uint64
	BlobCount         uint64
	TreeCount         uint64
}

type Storage

type Storage interface {
	Read(typ int, key string, f func(reader io.Reader) error) error
	Write(typ int, reader io.Reader) (string, error)
	Exist(typ int, key string) (bool, error)
	//Commit(typ int, key string) error
	Delete(typ int, key string) error
	UpdateRef(name string, expect string, desire string) error
	GetRef(name string) (string, error)
	GetRefs() ([]string, error)
	Status() (Status, error)
	HashFunc() kfscrypto.Hash
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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