Documentation
¶
Index ¶
- Variables
- type Config
- type File
- type FileInfo
- type Storage
- func (s *Storage) Copy(name string, dest string) error
- func (s *Storage) CopyDir(name string, dst string) error
- func (s *Storage) Delete(name string) error
- func (s *Storage) DeleteDir(name string) error
- func (s *Storage) Move(name string, dest string) error
- func (s *Storage) Open(name string) (*File, error)
- func (s *Storage) Read(name string) ([]byte, error)
- func (s *Storage) ReadDir(name string) ([]FileInfo, error)
- func (s *Storage) Rename(name, dest string) error
- func (s *Storage) Stat(name string) (*FileInfo, error)
- func (s *Storage) Write(name string, data []byte, opts WriteOptions) error
- type WriteOptions
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func New ¶
New creates a new storage interface It takes Config as its parameter. The function returns the Storage interface, and an error, if any.
func (*Storage) Copy ¶
Copy copies a file from one place to another. It takes the file name, and the destination name as its parameter. The function returns an error, if any.
func (*Storage) CopyDir ¶
CopyDir copies a directory from one place to another. It takes a folder nae, and the destination folder name as its parameter. The function returns an error, if any.
func (*Storage) Delete ¶
Delete deleted a file within the storage interface. It takes a file name as its parameter. The function returns an error, if any.
func (*Storage) DeleteDir ¶
DeleteDir deletes all files within a certain directory. It takes a folder name as its parameter. The function returns an error, if any.
func (*Storage) Move ¶
Move moves a file from one place to another. It takes a file name, and the destination name as its parameter. The function returns an error, if any.
func (*Storage) Open ¶
Open opens a file within the Storage interface. It takes a file name as its parameter. The function returns a File and an error, if any.
func (*Storage) Read ¶
Read opens a file within the Storage interfaces and reads the contents. It takes a file name as its parameter. The function returns a []byte, or an error, if any.
func (*Storage) ReadDir ¶
ReadDir reads all files within a certain directory. It takes a folder name as its parameter. The function returns an array of FileInfo, and an error, if any.