storage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Local

type Local struct {
	Root string
}

Local is a simple local filesystem storage implementation.

func NewLocal

func NewLocal(root string) (*Local, error)

NewLocal creates a new local filesystem storage backend.

func (*Local) Delete added in v0.1.1

func (l *Local) Delete(path string) error

func (*Local) Exists

func (l *Local) Exists(path string) bool

func (*Local) Get

func (l *Local) Get(path string) ([]byte, error)

func (*Local) List

func (l *Local) List(path string) ([]string, error)

func (*Local) Mkdir added in v0.1.1

func (l *Local) Mkdir(path string) error

func (*Local) Put

func (l *Local) Put(path string, data []byte) error

type Storage

type Storage interface {
	Put(path string, data []byte) error
	Get(path string) ([]byte, error)
	Exists(path string) bool
	List(path string) ([]string, error)
	Delete(path string) error
	Mkdir(path string) error
}

Storage is an interface for storing and retrieving files.

Jump to

Keyboard shortcuts

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