index

package
v0.0.0-...-314d597 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, driverCreator func(config any) (Driver, error))

Register a driver

Types

type Driver

type Driver interface {
	Create(path string) (File, error)
	Open(path string) (File, error)
	Remove(path string) error
	Rename(oldPath, newPath string) error
	Stat(path string) (fs.FileInfo, error)
	MakeDir(path string) error
	RemoveDir(path string) error
	RenameDir(oldPath, newPath string) error
	StatDir(path string) (fs.FileInfo, error)
	ListDir(path string) ([]fs.DirEntry, error)
	ReadFile(path string) ([]byte, error)
	WriteFile(path string, data []byte) error
	ReadFileStream(path string) (io.ReadCloser, error)
	WriteFileStream(path string, data io.Reader) error
	RemoveFile(path string) error
	FileSize(path string) (int64, error)
	FileModTime(path string) (int64, error)
}

func Get

func Get(name string, config any) (Driver, error)

gettin a driver

type File

type File interface {
	io.ReadWriteCloser

	Stat() (fs.FileInfo, error)
}

file[Stat]

Jump to

Keyboard shortcuts

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