blobcache

package
v0.0.0-...-424e234 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlobCacheServiceConfig blobCacheServiceConfig = blobCacheServiceConfig{
	Address:         "0.0.0.0:2049",
	PersistencePath: "/cache",
	PageSize:        1 << 21,
	CacheSize:       100000000,
}

Functions

This section is empty.

Types

type CacheService

type CacheService struct {
	proto.UnimplementedBlobCacheServer
	// contains filtered or unexported fields
}

func NewCacheService

func NewCacheService(persistencePath string, cacheSize, pageSize int64) (*CacheService, error)

func (*CacheService) GetContent

func (*CacheService) StartServer

func (cs *CacheService) StartServer(addr string) error

func (*CacheService) StoreContent

func (cs *CacheService) StoreContent(stream proto.BlobCache_StoreContentServer) error

type CacheServiceOpts

type CacheServiceOpts struct {
	Addr string
}

type ContentAddressableStorage

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

func NewContentAddressableStorage

func NewContentAddressableStorage(dir string, size int64, chunkSize int64) (*ContentAddressableStorage, error)

func (*ContentAddressableStorage) Add

func (cas *ContentAddressableStorage) Add(content []byte) (string, error)

func (*ContentAddressableStorage) Get

func (cas *ContentAddressableStorage) Get(hash string, offset, length int64) ([]byte, error)

Jump to

Keyboard shortcuts

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