You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
341 B
24 lines
341 B
2 months ago
|
package minioHandle
|
||
|
|
||
|
import (
|
||
|
"io"
|
||
|
|
||
|
"github.com/minio/minio-go/v6"
|
||
|
)
|
||
|
|
||
|
func (c *MinioClient) Put(objectType string, filename string, data io.Reader, size int) error {
|
||
|
_, err := c.Client.PutObject(
|
||
|
c.Bucket,
|
||
|
objectType+"/"+filename,
|
||
|
data,
|
||
|
int64(size),
|
||
|
minio.PutObjectOptions{},
|
||
|
)
|
||
|
|
||
|
if err != nil {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|