Documentation
¶
Index ¶
- Constants
- Variables
- type Credentials
- type Service
- func (s *Service) GetFile(bucketName, objectName string) (*minio.Object, error)
- func (s *Service) MakeBucket(bucketName string) error
- func (s *Service) UploadHttpFile(bucketName, ossName string, fileSize int64, reader io.Reader) error
- func (s *Service) UploadLocalFile(bucketName, ossName, file string) error
Constants ¶
View Source
const (
DefaultContentType = "multipart/form-data"
)
Variables ¶
View Source
var (
ErrorBucketExist = errors.New("bucket already exist")
)
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct { Endpoint string `json:"endpoint"` Url string `json:"url"` AccessKey string `json:"accessKey"` SecretKey string `json:"secretKey"` Api string `json:"api"` Path string `json:"path"` }
{"url":"http://127.0.0.1:9000","accessKey":"MJKJ20AedWTKEfDVXJGh","secretKey":"eVJLUEZv0jNLFZjKBHX62GgiMNCG19YqO5SyWc0F","api":"s3v4","path":"auto"}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) MakeBucket ¶
func (*Service) UploadHttpFile ¶
func (s *Service) UploadHttpFile(bucketName, ossName string, fileSize int64, reader io.Reader) error
UploadHttpFile http方式存储文件
@param bucketName string 桶对象 @param ossName string 资源对象名(上传后存储的名字) @param fileSize int64 文件大小 @param reader io.Reader io文件
@return
func (*Service) UploadLocalFile ¶
UploadLocalFile 上传本地文件到oss服务
@param bucketName string 桶对象 @param ossName string 资源对象名(上传后存储的名字) @param file string 具体的文件(相对路径,并完整路径名称)
@return
Click to show internal directories.
Click to hide internal directories.