local

package
v0.0.0-...-ebe581b Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewV2

func NewV2(rootPath string) (s.BasicStorage, error)

New creates Storage with given configuration returns error if any mistake occured, and process should cease

Types

type Storage

type Storage struct {
	RootPath string
}

Storage stores files locally

func New

func New(rootPath string) (*Storage, error)

New creates Storage with given configuration(local path) returns error if any mistake occured, and process should cease

func (*Storage) Delete

func (s *Storage) Delete(key string) (bool, error)

Delete delete a target from local by key

func (*Storage) Exist

func (s *Storage) Exist(key string) (bool, error)

Exist checks if target exists in local

func (*Storage) Load

func (s *Storage) Load(key string) (io.ReadCloser, error)

Load retrieves a target from local

func (*Storage) LoadStr

func (s *Storage) LoadStr(key string) (string, error)

func (*Storage) Save

func (s *Storage) Save(key string, value io.Reader) error

Save saves target to local

func (*Storage) SaveAndUpdate

func (s *Storage) SaveAndUpdate(key string, value io.Reader) error

SaveAndUpdate update a target in local

Jump to

Keyboard shortcuts

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