Documentation
¶
Index ¶
- Variables
- type FS
- func (fs *FS) AppendFile(path string, data []byte) error
- func (fs *FS) CopyFile(src, dst string) error
- func (fs *FS) CreateDir(path string) error
- func (fs *FS) CreateFile(path string) error
- func (l *FS) DefPerm() os.FileMode
- func (fs *FS) GetInfo(path string) (os.FileInfo, error)
- func (fs *FS) IsExist(path string) bool
- func (fs *FS) IsNotExist(path string) bool
- func (fs *FS) ListDir(path string) (map[string]os.FileInfo, error)
- func (fs *FS) ListDirRec(path string) (map[string]os.FileInfo, error)
- func (l *FS) MaxFileSize() int64
- func (l *FS) MaxNumObjs() int64
- func (l *FS) MaxReadSize() int64
- func (fs *FS) ReadDir(path string) (map[string][]byte, error)
- func (fs *FS) ReadDirRec(path string) (map[string][]byte, error)
- func (fs *FS) ReadFile(path string) ([]byte, error)
- func (fs *FS) Remove(path string) error
- func (fs *FS) RemoveDir(path string) error
- func (fs *FS) RemoveFile(path string) error
- func (fs *FS) Rename(src, dst string) error
- func (l *FS) SetDefPerm(perm os.FileMode)
- func (l *FS) SetMaxFileSize(max int64)
- func (l *FS) SetMaxNumObjs(max int64)
- func (l *FS) SetMaxReadSize(max int64)
- func (fs *FS) WriteFile(path string, data []byte) error
- type ILimits
- type IStorage
- type S3
- func (s *S3) AppendFile(path string, data []byte) error
- func (s *S3) CopyFile(src, dst string) error
- func (s *S3) CreateDir(path string) error
- func (s *S3) CreateFile(path string) error
- func (l *S3) DefPerm() os.FileMode
- func (s *S3) GetInfo(path string) (os.FileInfo, error)
- func (s *S3) IsExist(path string) bool
- func (s *S3) IsNotExist(path string) bool
- func (s *S3) ListDir(path string) (map[string]os.FileInfo, error)
- func (s *S3) ListDirRec(path string) (map[string]os.FileInfo, error)
- func (l *S3) MaxFileSize() int64
- func (l *S3) MaxNumObjs() int64
- func (l *S3) MaxReadSize() int64
- func (s *S3) ReadDir(path string) (map[string][]byte, error)
- func (s *S3) ReadDirRec(path string) (map[string][]byte, error)
- func (s *S3) ReadFile(path string) ([]byte, error)
- func (s *S3) Remove(path string) error
- func (s *S3) RemoveDir(path string) error
- func (s *S3) RemoveFile(path string) error
- func (s *S3) Rename(src, dst string) error
- func (l *S3) SetDefPerm(perm os.FileMode)
- func (l *S3) SetMaxFileSize(max int64)
- func (l *S3) SetMaxNumObjs(max int64)
- func (l *S3) SetMaxReadSize(max int64)
- func (s *S3) WriteFile(path string, data []byte) error
- type S3FileInfo
Constants ¶
This section is empty.
Variables ¶
var ( ErrInternal = errors.New("internal error") ErrAlreadyExists = errors.New("already exists") ErrNotFound = errors.New("not found") ErrLimitExceeded = errors.New("limit exceeded") ErrListFailed = errors.New("can't list") ErrCopyFailed = errors.New("can't copy") ErrOpenFailed = errors.New("can't open") ErrCreateFailed = errors.New("can't create") ErrReadFailed = errors.New("can't read") ErrWriteFailed = errors.New("can't write") ErrCloseFailed = errors.New("can't close") ErrRemoveFailed = errors.New("can't remove") ErrRenameFailed = errors.New("can't rename") )
Error list of storage package
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS is main class for FS API
func (*FS) AppendFile ¶
AppendFile is function that append data to an exist file
func (*FS) CopyFile ¶
CopyFile is function that copies a file from src to dst If src and dst files exist, and are the same, then return success.
func (*FS) CreateFile ¶
CreateFile is function for create new file if not exists
func (*FS) IsNotExist ¶
IsNotExist is function that return true if file not exists
func (*FS) ListDir ¶
ListDir is function that return listing directory with filea info Return key in the map is relative path from input base path.
func (*FS) ListDirRec ¶
ListDirRec is function that return listing directory with filea info Return key in the map is relative path from input base path.
func (*FS) MaxFileSize ¶
func (l *FS) MaxFileSize() int64
func (*FS) MaxNumObjs ¶
func (l *FS) MaxNumObjs() int64
func (*FS) MaxReadSize ¶
func (l *FS) MaxReadSize() int64
func (*FS) ReadDirRec ¶
ReadDirRec is function that recursive read all files in the directory
func (*FS) RemoveFile ¶
RemoveFile is function that remove an exist file
func (*FS) SetDefPerm ¶
func (*FS) SetMaxFileSize ¶
func (l *FS) SetMaxFileSize(max int64)
func (*FS) SetMaxNumObjs ¶
func (l *FS) SetMaxNumObjs(max int64)
func (*FS) SetMaxReadSize ¶
func (l *FS) SetMaxReadSize(max int64)
type ILimits ¶
type ILimits interface {
DefPerm() os.FileMode
SetDefPerm(perm os.FileMode)
MaxFileSize() int64
SetMaxFileSize(max int64)
MaxReadSize() int64
SetMaxReadSize(max int64)
MaxNumObjs() int64
SetMaxNumObjs(max int64)
}
ILimits is additional interface for limits control
type IStorage ¶
type IStorage interface {
ListDir(path string) (map[string]os.FileInfo, error)
ListDirRec(path string) (map[string]os.FileInfo, error)
GetInfo(path string) (os.FileInfo, error)
IsExist(path string) bool
IsNotExist(path string) bool
ReadFile(path string) ([]byte, error)
ReadDir(path string) (map[string][]byte, error)
ReadDirRec(path string) (map[string][]byte, error)
CreateDir(path string) error
CreateFile(path string) error
WriteFile(path string, data []byte) error
AppendFile(path string, data []byte) error
RemoveDir(path string) error
RemoveFile(path string) error
Remove(path string) error
Rename(old, new string) error
CopyFile(src, dst string) error
ILimits
}
IStorage is main interface for using external storages
type S3 ¶
type S3 struct {
// contains filtered or unexported fields
}
S3 is main class for S3 API
func (*S3) AppendFile ¶
AppendFile is function that append data to an exist file
func (*S3) CreateFile ¶
CreateFile is function for create new file if not exists
func (*S3) IsNotExist ¶
IsNotExist is function that return true if file not exists
func (*S3) ListDirRec ¶
ListDirRec is function that return listing directory with filea info
func (*S3) MaxFileSize ¶
func (l *S3) MaxFileSize() int64
func (*S3) MaxNumObjs ¶
func (l *S3) MaxNumObjs() int64
func (*S3) MaxReadSize ¶
func (l *S3) MaxReadSize() int64
func (*S3) ReadDirRec ¶
ReadDirRec is function that recursive read all files in the directory
func (*S3) RemoveFile ¶
RemoveFile is function that remove an exist file
func (*S3) SetDefPerm ¶
func (*S3) SetMaxFileSize ¶
func (l *S3) SetMaxFileSize(max int64)
func (*S3) SetMaxNumObjs ¶
func (l *S3) SetMaxNumObjs(max int64)
func (*S3) SetMaxReadSize ¶
func (l *S3) SetMaxReadSize(max int64)
type S3FileInfo ¶
type S3FileInfo struct {
*minio.ObjectInfo
// contains filtered or unexported fields
}
S3FileInfo is struct with interface os.FileInfo
func (*S3FileInfo) IsDir ¶
func (si *S3FileInfo) IsDir() bool
IsDir is function that return true if it's directory
func (*S3FileInfo) ModTime ¶
func (si *S3FileInfo) ModTime() time.Time
ModTime is function that return last modification time
func (*S3FileInfo) Mode ¶
func (si *S3FileInfo) Mode() os.FileMode
Mode is function that return file mod structure
func (*S3FileInfo) Name ¶
func (si *S3FileInfo) Name() string
Name is function that return file name
func (*S3FileInfo) Sys ¶
func (si *S3FileInfo) Sys() interface{}
Sys is function that return dummy info