Documentation
¶
Index ¶
- Constants
- Variables
- type AbstractAdapter
- type Flysystem
- func (f *Flysystem) Copy(source, destination string) (bool, error)
- func (f *Flysystem) CreateDirectory(dirname string) error
- func (f *Flysystem) Delete(path string) (int64, error)
- func (f *Flysystem) DeleteDirectory(dirname string) (int64, error)
- func (f *Flysystem) Disk(disk string) IFlysystem
- func (f *Flysystem) Exists(path string) (bool, error)
- func (f *Flysystem) Extend(name string, adapter IAdapter) IFlysystem
- func (f *Flysystem) FindAdapter() IAdapter
- func (f *Flysystem) MimeType(path string) (string, error)
- func (f *Flysystem) Move(source, destination string) (bool, error)
- func (f *Flysystem) Read(path string) ([]byte, error)
- func (f *Flysystem) Size(path string) (int64, error)
- func (f *Flysystem) Update(path string, contents []byte) (string, error)
- func (f *Flysystem) UpdateStream(path, resource string) (string, error)
- func (f *Flysystem) Write(path string, contents []byte) (string, error)
- func (f *Flysystem) WriteStream(path, resource string) (string, error)
- type IAdapter
- type IFS
- type IFlysystem
- type Path
Constants ¶
View Source
const ( PathTypeFile = "file" PathTypeDirectory = "directory" ModePublicString = "public" ModePrivateString = "private" ModeFilePublic = 0644 ModeFilePrivate = 0600 ModeDirPublic = 0755 ModeDirPrivate = 0700 )
Variables ¶
View Source
var ( FileModes = map[string]map[string]os.FileMode{ PathTypeFile: { ModePublicString: ModeFilePublic, ModePrivateString: ModeFilePrivate, }, PathTypeDirectory: { ModePublicString: ModeDirPublic, ModePrivateString: ModeDirPrivate, }, } )
Functions ¶
This section is empty.
Types ¶
type AbstractAdapter ¶
type AbstractAdapter struct {
// contains filtered or unexported fields
}
func (*AbstractAdapter) ApplyPathPrefix ¶
func (a *AbstractAdapter) ApplyPathPrefix(path string) string
func (*AbstractAdapter) SetPathPrefix ¶
func (a *AbstractAdapter) SetPathPrefix(prefix string)
type Flysystem ¶
type Flysystem struct {
// contains filtered or unexported fields
}
func (*Flysystem) CreateDirectory ¶
func (*Flysystem) DeleteDirectory ¶
func (*Flysystem) Disk ¶
func (f *Flysystem) Disk(disk string) IFlysystem
func (*Flysystem) Extend ¶
func (f *Flysystem) Extend(name string, adapter IAdapter) IFlysystem
Extend 扩展
func (*Flysystem) UpdateStream ¶
type IFS ¶
type IFS interface {
// Exists Determine if the file exists
Exists(path string) (bool, error)
// Size Get File Size
Size(path string) (int64, error)
// Write write file content and return full path
Write(path string, contents []byte) (string, error)
// WriteStream Resource file write returns full path
WriteStream(path, resource string) (string, error)
// Update Update the file content and return the updated full path
Update(path string, contents []byte) (string, error)
// UpdateStream Return the updated full path based on resource file updates
UpdateStream(path, resource string) (string, error)
// Read Read file
Read(path string) ([]byte, error)
// Delete Deleting files returns the number of deleted files
Delete(path string) (int64, error)
// DeleteDirectory Number of files deleted from the deleted directory
DeleteDirectory(dirname string) (int64, error)
// CreateDirectory create directory
CreateDirectory(dirname string) error
// MimeType Get File MimeType
MimeType(path string) (string, error)
// Move move file
Move(source, destination string) (bool, error)
// Copy copy file
Copy(source, destination string) (bool, error)
}
type IFlysystem ¶
type IFlysystem interface {
IFS
Extend(name string, adapter IAdapter) IFlysystem
Disk(disk string) IFlysystem
FindAdapter() IAdapter
}
func New ¶
func New() IFlysystem
func NewAdapters ¶
func NewAdapters(adapters ...IAdapter) IFlysystem
Click to show internal directories.
Click to hide internal directories.