Documentation ¶
Index ¶
- Constants
- Variables
- type Flysystem
- func (f *Flysystem) Copy(source, destination string) (bool, error)
- func (f *Flysystem) Delete(path string) (int64, error)
- func (f *Flysystem) Disk(disk string) IFlysystem
- func (f *Flysystem) Exists(path string) (bool, error)
- func (f *Flysystem) Extend(adapter IAdapter, names ...string) 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) WriteReader(path string, reader io.Reader) (string, error)
- func (f *Flysystem) WriteStream(path, resource string) (string, error)
- type IAdapter
- type IBFS
- type IFS
- type IFlysystem
Constants ¶
View Source
const ( DiskNameLocal = v2.DiskNameLocal DiskNameOSS = v2.DiskNameOSS DiskNameCOS = v2.DiskNameCOS DiskNameBOS = v2.DiskNameBOS DiskNameGoogleCloudCloudStorage = v2.DiskNameGoogleCloudCloudStorage DiskNameQiNiuKoDo = v2.DiskNameQiNiuKoDo 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 Flysystem ¶
type Flysystem struct {
// contains filtered or unexported fields
}
func (*Flysystem) Disk ¶
func (f *Flysystem) Disk(disk string) IFlysystem
func (*Flysystem) Extend ¶
func (f *Flysystem) Extend(adapter IAdapter, names ...string) IFlysystem
Extend 扩展
func (*Flysystem) UpdateStream ¶
func (*Flysystem) WriteReader ¶ added in v0.0.2
type IBFS ¶ added in v0.0.3
type IBFS interface { // Exists Determine if the file exists Exists(path string) (bool, error) // WriteReader write file content and return full path WriteReader(path string, reader io.Reader) (string, error) // 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) // Read Read file Read(path string) ([]byte, error) // Delete Deleting files returns the number of deleted files Delete(path string) (int64, error) }
type IFS ¶
type IFS interface { IBFS // Size Get File Size Size(path string) (int64, error) // 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) // 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(adapter IAdapter, names ...string) 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.