This commit is contained in:
parent
224279f2cb
commit
e596e388b4
14
pkg/S3/s3.go
14
pkg/S3/s3.go
@ -21,23 +21,15 @@ func getS3Client() (*s3.Client, error) {
|
|||||||
"C2H2aITHRDpek8H921yhnrINZwDoADsjW3F6HURl",
|
"C2H2aITHRDpek8H921yhnrINZwDoADsjW3F6HURl",
|
||||||
"",
|
"",
|
||||||
)),
|
)),
|
||||||
awsConfig.WithEndpointResolver(aws.EndpointResolverFunc(
|
|
||||||
func(service, region string) (aws.Endpoint, error) {
|
|
||||||
return aws.Endpoint{
|
|
||||||
URL: "https://s3.regru.cloud",
|
|
||||||
SigningRegion: "ru-central1",
|
|
||||||
Source: aws.EndpointSourceCustom,
|
|
||||||
}, nil
|
|
||||||
},
|
|
||||||
)),
|
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Создаем клиент с кастомным эндпоинтом
|
// Используем virtual-hosted-style endpoint
|
||||||
client := s3.NewFromConfig(cfg, func(o *s3.Options) {
|
client := s3.NewFromConfig(cfg, func(o *s3.Options) {
|
||||||
o.UsePathStyle = true // Важно для некоторых S3 провайдеров
|
o.BaseEndpoint = aws.String("https://tailly.website.regru.cloud")
|
||||||
|
o.UsePathStyle = false // Отключаем path-style
|
||||||
})
|
})
|
||||||
|
|
||||||
return client, nil
|
return client, nil
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user