local

package
v0.0.0-...-35dc932 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

README

Web File System - Local files driver

File system abstraction with access management This is the Local File System adapter for the core interface

API provides common file operations for some folder on local drive. Any operations outside of the folder will be blocked. Also, it possible to configure a custom policy for read/write operations.

Can be used as backend for Webix File Manager https://webix.com/filemanager

API

Initialization
import (
	"github.com/xbsoftware/wfs-local"
)

fs, err := wfs.NewLocalDrive("./sandbox", nil)
License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLocalDrive

func NewLocalDrive(path string, config *wfs.DriveConfig) (wfs.Drive, error)

Types

type LocalDrive

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

func (*LocalDrive) Comply

func (l *LocalDrive) Comply(f wfs.FileID, operation int) bool

func (*LocalDrive) Copy

func (l *LocalDrive) Copy(source, target wfs.FileID, name string, isFolder bool) (wfs.FileID, error)

func (*LocalDrive) Exists

func (l *LocalDrive) Exists(f wfs.FileID, name string) bool

func (*LocalDrive) GetParent

func (l *LocalDrive) GetParent(f wfs.FileID) wfs.FileID

func (*LocalDrive) Info

func (l *LocalDrive) Info(f wfs.FileID) (wfs.FileInfo, error)

Info returns info about a single file

func (*LocalDrive) List

func (l *LocalDrive) List(f wfs.FileID) ([]wfs.FileInfo, error)

func (*LocalDrive) Make

func (l *LocalDrive) Make(f wfs.FileID, name string, isFolder bool) (wfs.FileID, error)

func (*LocalDrive) Move

func (l *LocalDrive) Move(source, target wfs.FileID, name string, isFolder bool) (wfs.FileID, error)

Move renames(moves) a file or a folder

func (*LocalDrive) Read

func (l *LocalDrive) Read(f wfs.FileID) (io.ReadSeeker, error)

func (*LocalDrive) Remove

func (l *LocalDrive) Remove(f wfs.FileID) error

func (*LocalDrive) Search

func (l *LocalDrive) Search(f wfs.FileID, search string) ([]wfs.FileInfo, error)

func (*LocalDrive) Stats

func (l *LocalDrive) Stats() (uint64, uint64, error)

func (*LocalDrive) ToFileID

func (l *LocalDrive) ToFileID(id string) wfs.FileID

func (*LocalDrive) Write

func (l *LocalDrive) Write(f wfs.FileID, data io.Reader) error

Jump to

Keyboard shortcuts

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