Refactor du projet réduire le nombre de packages et sous-dossiers #200
1 changed files with 3 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
package media
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
@ -8,7 +8,6 @@ import (
|
||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"git.agecem.com/agecem/agecem-org/config"
|
|
||||||
"github.com/minio/minio-go/v7"
|
"github.com/minio/minio-go/v7"
|
||||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
@ -37,7 +36,7 @@ func NewMediaClient(endpoint, accessKeyId, secretAccessKey string, useSSL bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMediaClientFromViper() (*MediaClient, error) {
|
func NewMediaClientFromViper() (*MediaClient, error) {
|
||||||
var cfg config.Config
|
var cfg Config
|
||||||
if err := viper.Unmarshal(&cfg); err != nil {
|
if err := viper.Unmarshal(&cfg); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -55,7 +54,7 @@ type MediaClient struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MediaClient) Seed() ([]string, error) {
|
func (m *MediaClient) Seed() ([]string, error) {
|
||||||
var cfg config.Config
|
var cfg Config
|
||||||
if err := viper.Unmarshal(&cfg); err != nil {
|
if err := viper.Unmarshal(&cfg); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
Loading…
Reference in a new issue