Skip to content

Commit cbfe33d

Browse files
committed
refactor: standardize endpoint field name in Config struct
Signed-off-by: tbxark <[email protected]>
1 parent a45a9f4 commit cbfe33d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

storage/s3/s3.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
)
1515

1616
type Config struct {
17-
EndPoint string `json:"end_point"`
17+
Endpoint string `json:"endpoint"`
1818
AccessKeyID string `json:"access_key"`
1919
SecretAccessKey string `json:"secret"`
2020
Token string `json:"token"`
@@ -28,7 +28,7 @@ type Client struct {
2828
}
2929

3030
func NewClient(config *Config) (*Client, error) {
31-
client, err := minio.New(config.EndPoint, &minio.Options{
31+
client, err := minio.New(config.Endpoint, &minio.Options{
3232
Creds: credentials.NewStaticV4(config.AccessKeyID, config.SecretAccessKey, config.Token),
3333
Secure: config.UseSSL,
3434
})
@@ -48,7 +48,7 @@ func (s *Client) GenerateURL(key string) string {
4848
if strings.HasPrefix(key, "http://") || strings.HasPrefix(key, "https://") {
4949
return key
5050
}
51-
return fmt.Sprintf("%s/%s/%s", s.config.EndPoint, s.config.Bucket, strings.TrimPrefix(key, "/"))
51+
return fmt.Sprintf("%s/%s/%s", s.config.Endpoint, s.config.Bucket, strings.TrimPrefix(key, "/"))
5252
}
5353

5454
func (s *Client) GenerateURLs(keys []string) []string {
@@ -80,7 +80,7 @@ func (s *Client) ExtractKeyFromURLWithMode(uri string, strict bool) (string, err
8080
if err != nil {
8181
return "", nil
8282
}
83-
if u.Host != s.config.EndPoint {
83+
if u.Host != s.config.Endpoint {
8484
if strict {
8585
return "", fmt.Errorf("invalid url")
8686
}

0 commit comments

Comments
 (0)