Documentation
¶
Index ¶
- type LocalFilesystem
- func (fs *LocalFilesystem) Delete(path string) error
- func (fs *LocalFilesystem) Exists(path string) bool
- func (fs *LocalFilesystem) Get(path string) ([]byte, error)
- func (fs *LocalFilesystem) GetImageWidthHeight(path string) (int, int, error)
- func (fs *LocalFilesystem) GetSignedUrl(path string, expires int64) (string, error)
- func (fs *LocalFilesystem) GetUrl(path string) string
- func (fs *LocalFilesystem) MustGetSignedUrl(path string, expires int64) string
- func (fs *LocalFilesystem) Put(ctx context.Context, path string, data []byte) error
- func (fs *LocalFilesystem) PutWithoutContext(path string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalFilesystem ¶
func NewStorage ¶
func NewStorage(root string, baseUrl string) *LocalFilesystem
func (*LocalFilesystem) Exists ¶
func (fs *LocalFilesystem) Exists(path string) bool
Exists 判断文件是否存在
func (*LocalFilesystem) GetImageWidthHeight ¶
func (fs *LocalFilesystem) GetImageWidthHeight(path string) (int, int, error)
func (*LocalFilesystem) GetSignedUrl ¶
func (fs *LocalFilesystem) GetSignedUrl(path string, expires int64) (string, error)
GetSignedUrl 获取签名URL
func (*LocalFilesystem) GetUrl ¶
func (fs *LocalFilesystem) GetUrl(path string) string
GetUrl 获取文件完整路径 当路径是绝对路径时,忽略Root配置
func (*LocalFilesystem) MustGetSignedUrl ¶
func (fs *LocalFilesystem) MustGetSignedUrl(path string, expires int64) string
MustGetSignedUrl 获取签名URL
func (*LocalFilesystem) PutWithoutContext ¶
func (fs *LocalFilesystem) PutWithoutContext(path string, data []byte) error
Click to show internal directories.
Click to hide internal directories.