largefile

package module
v0.0.0-...-2cfde8c Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PathEncoding = base32.NewEncoding("abcdefghijklmnopqrstuvwxyz234567").WithPadding(base32.NoPadding)

Functions

func InitTable

func InitTable(conn *sql.DB) error

func NewReader

func NewReader(db *sql.DB, dir string, ref blobstore.BlobRef) (*reader, error)

func NewReaderFromEntry

func NewReaderFromEntry(dir string, sourceFile string, size int64, offset int64) (*reader, error)

func NewWriter

func NewWriter(db *sql.DB, dir string, ref blobstore.BlobRef) (*writer, error)

func RefToFile

func RefToFile(ref blobstore.BlobRef) string

func TestStores

func TestStores(t *testing.T, e func(ctx context.Context, t *testing.T, store blobstore.Blobs))

func TestWithDb

func TestWithDb(t *testing.T, ctx context.Context, test func(ctx context.Context, store *LargeFileStore))

Types

type BlobInfo

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

func (BlobInfo) BlobRef

func (i BlobInfo) BlobRef() blobstore.BlobRef

func (BlobInfo) FullPath

func (i BlobInfo) FullPath(ctx context.Context) (string, error)

func (BlobInfo) Stat

func (i BlobInfo) Stat(ctx context.Context) (os.FileInfo, error)

func (BlobInfo) StorageFormatVersion

func (i BlobInfo) StorageFormatVersion() blobstore.FormatVersion

type FileInfo

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

func (FileInfo) IsDir

func (f FileInfo) IsDir() bool

func (FileInfo) ModTime

func (f FileInfo) ModTime() time.Time

func (FileInfo) Mode

func (f FileInfo) Mode() fs.FileMode

func (FileInfo) Name

func (f FileInfo) Name() string

func (FileInfo) Size

func (f FileInfo) Size() int64

func (FileInfo) Sys

func (f FileInfo) Sys() any

type LargeFileStore

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

func NewBlobStore

func NewBlobStore(connDef string, dir string) (*LargeFileStore, error)

func (*LargeFileStore) CheckWritability

func (b *LargeFileStore) CheckWritability(ctx context.Context) error

func (*LargeFileStore) Close

func (b *LargeFileStore) Close() error

func (*LargeFileStore) Create

func (*LargeFileStore) CreateVerificationFile

func (b *LargeFileStore) CreateVerificationFile(ctx context.Context, id storj.NodeID) error

func (*LargeFileStore) Delete

func (b *LargeFileStore) Delete(ctx context.Context, ref blobstore.BlobRef) error

func (*LargeFileStore) DeleteNamespace

func (b *LargeFileStore) DeleteNamespace(ctx context.Context, ref []byte) (err error)

func (*LargeFileStore) DeleteWithStorageFormat

func (b *LargeFileStore) DeleteWithStorageFormat(ctx context.Context, ref blobstore.BlobRef, formatVer blobstore.FormatVersion) error

func (*LargeFileStore) EmptyTrash

func (b *LargeFileStore) EmptyTrash(ctx context.Context, namespace []byte, trashedBefore time.Time) (int64, [][]byte, error)

func (*LargeFileStore) FreeSpace

func (b *LargeFileStore) FreeSpace(ctx context.Context) (int64, error)

func (*LargeFileStore) ListNamespaces

func (b *LargeFileStore) ListNamespaces(ctx context.Context) ([][]byte, error)

func (*LargeFileStore) Open

func (*LargeFileStore) OpenWithStorageFormat

func (b *LargeFileStore) OpenWithStorageFormat(ctx context.Context, ref blobstore.BlobRef, formatVer blobstore.FormatVersion) (blobstore.BlobReader, error)

func (*LargeFileStore) RenameRef

func (b *LargeFileStore) RenameRef(ctx context.Context, ref1 blobstore.BlobRef, name string) error

func (*LargeFileStore) RestoreTrash

func (b *LargeFileStore) RestoreTrash(ctx context.Context, namespace []byte) ([][]byte, error)

func (*LargeFileStore) SpaceUsedForBlobs

func (b *LargeFileStore) SpaceUsedForBlobs(ctx context.Context) (res int64, err error)

func (*LargeFileStore) SpaceUsedForBlobsInNamespace

func (b *LargeFileStore) SpaceUsedForBlobsInNamespace(ctx context.Context, namespace []byte) (res int64, err error)

func (*LargeFileStore) SpaceUsedForTrash

func (b *LargeFileStore) SpaceUsedForTrash(ctx context.Context) (res int64, err error)

func (*LargeFileStore) Stat

func (*LargeFileStore) StatWithStorageFormat

func (b *LargeFileStore) StatWithStorageFormat(ctx context.Context, ref blobstore.BlobRef, formatVer blobstore.FormatVersion) (blobstore.BlobInfo, error)

func (*LargeFileStore) Trash

func (b *LargeFileStore) Trash(ctx context.Context, ref blobstore.BlobRef) error

func (*LargeFileStore) VerifyStorageDir

func (b *LargeFileStore) VerifyStorageDir(ctx context.Context, id storj.NodeID) error

func (*LargeFileStore) WalkNamespace

func (b *LargeFileStore) WalkNamespace(ctx context.Context, namespace []byte, walkFunc func(blobstore.BlobInfo) error) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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