idk
This commit is contained in:
@@ -9,10 +9,13 @@ import (
|
|||||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var dbConn *minio.Client
|
||||||
|
|
||||||
func MinInit() {
|
func MinInit() {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
dbConn, err := minio.New("localhost:9000", &minio.Options{
|
var err error
|
||||||
|
dbConn, err = minio.New("localhost:9000", &minio.Options{
|
||||||
Creds: credentials.NewStaticV4("root", "change_to_env", ""),
|
Creds: credentials.NewStaticV4("root", "change_to_env", ""),
|
||||||
Secure: false,
|
Secure: false,
|
||||||
}) // TODO change in production
|
}) // TODO change in production
|
||||||
@@ -33,6 +36,9 @@ func MinInit() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func putFile(ctx context.Context, key string, reader io.Reader, size uint32, contentType string) error {
|
func putFile(ctx context.Context, key string, reader io.Reader, size uint32, contentType string, meta map[string]string) error {
|
||||||
|
dbConn.PutObject(ctx, globals.FileStorageBucketName, key, reader, int64(size), minio.PutObjectOptions{
|
||||||
|
ContentType: contentType,
|
||||||
|
UserMetadata: meta,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,3 +102,6 @@ type WsAuthMessage struct {
|
|||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Error string `json:"error"`
|
Error string `json:"error"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Metadata struct {
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user