server

package
v0.0.0-...-e2d6795 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBlobStoreService

func NewBlobStoreService(store Store) *blobStoreService

Types

type BlobInfo

type BlobInfo struct {
	Length int64
}

type FilesystemStore

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

func NewFilesystemStore

func NewFilesystemStore(path string) *FilesystemStore

func (*FilesystemStore) CreateBlob

func (s *FilesystemStore) CreateBlob(ctx context.Context, sha256 []byte, content io.Reader) (*BlobInfo, error)

func (*FilesystemStore) Open

func (s *FilesystemStore) Open(ctx context.Context, sha256 []byte) (io.ReadCloser, error)

type Store

type Store interface {
	// CreateBlob will create a blob from the content, verifying the sha256 hash matches.
	CreateBlob(ctx context.Context, sha256 []byte, content io.Reader) (*BlobInfo, error)
	// OpenBlob returns a reader for the blob with specified sha256 hash.
	Open(ctx context.Context, sha256 []byte) (io.ReadCloser, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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