Documentation ¶
Index ¶
- type ObjectStorage
- func (receiver *ObjectStorage) BuildBasePath() string
- func (receiver *ObjectStorage) PutFile(localFile string) (UploadFileInfo, error)
- func (receiver *ObjectStorage) PutFileByFileInfo(fileInfo drives.FileInfo) (UploadFileInfo, error)
- func (receiver *ObjectStorage) PutFileHeaderFile(file *multipart.FileHeader) (UploadFileInfo, error)
- func (receiver *ObjectStorage) PutNetFile(fileUrl string) (UploadFileInfo, error)
- func (receiver *ObjectStorage) PutStr(content string) (UploadFileInfo, error)
- func (receiver *ObjectStorage) SetFilePath(filePathKey string) *ObjectStorage
- type UploadFileInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectStorage ¶
type ObjectStorage struct { // 存储驱动 Drive drives.ObjectStorageDrive // 是否依据文件类型自动补充文件后缀 IsAppendExt bool // 路径前缀 FilePathPrefix string // 是否自动生产路径 IsAutomaticProductionPath bool // 文件存储路径 FilePathKey string // 文件存储基础URL地址 BaseUrl string }
func (*ObjectStorage) BuildBasePath ¶
func (receiver *ObjectStorage) BuildBasePath() string
BuildBasePath 生成基础路径
func (*ObjectStorage) PutFile ¶
func (receiver *ObjectStorage) PutFile(localFile string) (UploadFileInfo, error)
PutFile 上传本地文件
func (*ObjectStorage) PutFileByFileInfo ¶
func (receiver *ObjectStorage) PutFileByFileInfo(fileInfo drives.FileInfo) (UploadFileInfo, error)
执行不同类型的文件上传 +------------------------------------------------------------------------------------------ PutFileByFileInfo 通过自行构建FileInfo上传
func (*ObjectStorage) PutFileHeaderFile ¶
func (receiver *ObjectStorage) PutFileHeaderFile(file *multipart.FileHeader) (UploadFileInfo, error)
PutFileHeaderFile 读取文件流中文件信息
func (*ObjectStorage) PutNetFile ¶
func (receiver *ObjectStorage) PutNetFile(fileUrl string) (UploadFileInfo, error)
PutNetFile 上传网络文件
func (*ObjectStorage) PutStr ¶
func (receiver *ObjectStorage) PutStr(content string) (UploadFileInfo, error)
PutStr 上传文本内容
func (*ObjectStorage) SetFilePath ¶
func (receiver *ObjectStorage) SetFilePath(filePathKey string) *ObjectStorage
SetFilePath 设置文件存储路径
type UploadFileInfo ¶
Click to show internal directories.
Click to hide internal directories.