local

package
v0.0.0-...-c9fddc1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveRef

func SaveRef(ctx context.Context, path string, fi os.FileInfo, ref types.Ref) error

SaveRef stores the ref into file's metadata. Additionally, it will write the size and mtime to know if ref is still valid.

func SaveRefFile

func SaveRefFile(ctx context.Context, f *os.File, fi os.FileInfo, ref types.Ref) error

SaveRefFile stores the ref into file's metadata. Additionally, it will write the size and mtime to know if ref is still valid.

func Stat

func Stat(ctx context.Context, path string) (types.SizedRef, error)

Stat returns the size of the file and the ref if it's written into the metadata and considered valid.

func StatFile

func StatFile(ctx context.Context, f *os.File) (types.SizedRef, error)

StatFile returns the size of the file and the ref if it's written into the metadata and considered valid.

Types

type Config

type Config struct {
	Dir string `json:"dir"`
}

func (*Config) OpenStorage

func (c *Config) OpenStorage(ctx context.Context) (storage.Storage, error)

func (*Config) References

func (c *Config) References() []types.Ref

type Storage

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

func New

func New(dir string, create bool) (*Storage, error)

func (*Storage) BeginBlob

func (s *Storage) BeginBlob(ctx context.Context) (storage.BlobWriter, error)

func (*Storage) Close

func (s *Storage) Close() error

func (*Storage) DeletePin

func (s *Storage) DeletePin(ctx context.Context, name string) error

func (*Storage) FetchBlob

func (s *Storage) FetchBlob(ctx context.Context, ref types.Ref) (io.ReadCloser, uint64, error)

func (*Storage) FetchSchema

func (s *Storage) FetchSchema(ctx context.Context, ref types.Ref) (io.ReadCloser, uint64, error)

func (*Storage) GetPin

func (s *Storage) GetPin(ctx context.Context, name string) (types.Ref, error)

func (*Storage) ImportFile

func (s *Storage) ImportFile(ctx context.Context, path string) (types.SizedRef, error)

func (*Storage) IterateBlobs

func (s *Storage) IterateBlobs(ctx context.Context) storage.Iterator

func (*Storage) IteratePins

func (s *Storage) IteratePins(ctx context.Context) storage.PinIterator

func (*Storage) IterateSchema

func (s *Storage) IterateSchema(ctx context.Context, typs ...string) storage.SchemaIterator

func (*Storage) ReindexSchema

func (s *Storage) ReindexSchema(ctx context.Context, force bool) error

func (*Storage) SetPin

func (s *Storage) SetPin(ctx context.Context, name string, ref types.Ref) error

func (*Storage) StatBlob

func (s *Storage) StatBlob(ctx context.Context, ref types.Ref) (uint64, error)

Jump to

Keyboard shortcuts

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