fsstore

package
v1.0.46 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

TODO use fs.FS

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Dir     string
	TempDir string
}

type Store

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

func New

func New(c Config) (*Store, error)

func (*Store) Add

func (s *Store) Add(ctx context.Context, r io.Reader, oldChecksum string) (string, error)

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, checksum string) error

TODO remove empty intermediate directories?

func (*Store) DeleteAll

func (s *Store) DeleteAll(ctx context.Context) error

func (*Store) Exists

func (s *Store) Exists(ctx context.Context, checksum string) (bool, error)

func (*Store) Get

func (s *Store) Get(ctx context.Context, checksum string) (io.ReadCloser, error)

Jump to

Keyboard shortcuts

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