Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// DirFileHolder Default file holder for directory
DirFileHolder = "dir.info"
)
Functions ¶
Types ¶
type IStorage ¶
type IStorage interface {
// Put Create a file with content string
Put(path, contents string) bool
// PutData Create a file with content byte
PutData(path string, contents []byte) bool
// PutFile Create a file from another file source
PutFile(path string, fileSource *os.File) bool
// Delete Remove a file
Delete(path string) bool
// Copy Clone file to another location
Copy(from, to string) bool
// Move Switch file location to new place
Move(from, to string) bool
// Exists Check existed file
Exists(path string) bool
// Get Receive a file content
Get(path string) ([]byte, error)
// Size Get file size
Size(path string) int64
// LastModified Obtains last modified of file
LastModified(path string) time.Time
// Url Absolute URL (Public URL)
Url(path string) string
// MakeDir Create new directory
MakeDir(dir string) bool
// DeleteDir Remove empty directory
DeleteDir(dir string) bool
// Append Add string content to bottom file
Append(path, data string) bool
// GetStream returns a stream (io.ReadCloser) for the object at the given path
// This allows for efficient streaming without loading the entire file into memory
GetStream(path string) (io.ReadCloser, error)
}
IStorage Storage interface
Click to show internal directories.
Click to hide internal directories.