storage

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalStorage

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

LocalStorage is a storage implementation that stores objects on the local filesystem.

func NewLocalStorage

func NewLocalStorage(root string) *LocalStorage

NewLocalStorage creates a new LocalStorage.

func (*LocalStorage) Delete

func (l *LocalStorage) Delete(name string) error

Delete implements Storage.

func (*LocalStorage) Exists

func (l *LocalStorage) Exists(name string) (bool, error)

Exists implements Storage.

func (*LocalStorage) Open

func (l *LocalStorage) Open(name string) (Object, error)

Open implements Storage.

func (*LocalStorage) Put

func (l *LocalStorage) Put(name string, r io.Reader) (int64, error)

Put implements Storage.

func (*LocalStorage) Rename

func (l *LocalStorage) Rename(oldName, newName string) error

Rename implements Storage.

func (*LocalStorage) Stat

func (l *LocalStorage) Stat(name string) (fs.FileInfo, error)

Stat implements Storage.

type Object

type Object interface {
	io.Seeker
	fs.File
	Name() string
}

Object is an interface for objects that can be stored.

type Storage

type Storage interface {
	Open(name string) (Object, error)
	Stat(name string) (fs.FileInfo, error)
	Put(name string, r io.Reader) (int64, error)
	Delete(name string) error
	Exists(name string) (bool, error)
	Rename(oldName, newName string) error
}

Storage is an interface for storing and retrieving objects.

Jump to

Keyboard shortcuts

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