• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / deployments / 1197570064

01 Mar 2024 06:24PM UTC coverage: 52.222% (-28.4%) from 80.645%
1197570064

Pull #998

gitlab-ci

web-flow
chore: bump github.com/Azure/azure-sdk-for-go/sdk/azcore

Bumps [github.com/Azure/azure-sdk-for-go/sdk/azcore](https://github.com/Azure/azure-sdk-for-go) from 1.9.1 to 1.10.0.
- [Release notes](https://github.com/Azure/azure-sdk-for-go/releases)
- [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md)
- [Commits](https://github.com/Azure/azure-sdk-for-go/compare/sdk/azcore/v1.9.1...sdk/azcore/v1.10.0)

---
updated-dependencies:
- dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azcore
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #998: chore: bump github.com/Azure/azure-sdk-for-go/sdk/azcore from 1.9.1 to 1.10.0

5218 of 9992 relevant lines covered (52.22%)

0.55 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

35.71
/storage/azblob/options.go
1
// Copyright 2023 Northern.tech AS
2
//
3
//    Licensed under the Apache License, Version 2.0 (the "License");
4
//    you may not use this file except in compliance with the License.
5
//    You may obtain a copy of the License at
6
//
7
//        http://www.apache.org/licenses/LICENSE-2.0
8
//
9
//    Unless required by applicable law or agreed to in writing, software
10
//    distributed under the License is distributed on an "AS IS" BASIS,
11
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
//    See the License for the specific language governing permissions and
13
//    limitations under the License.
14

15
package azblob
16

17
import (
18
        "fmt"
19
        "net/url"
20

21
        "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob"
22
)
23

24
const (
25
        BufferSizeMin     = 4 * 1024          // 4KiB
26
        BufferSizeDefault = 8 * BufferSizeMin // 32KiB - same default as used in io.Copy
27
)
28

29
type SharedKeyCredentials struct {
30
        AccountName string
31
        AccountKey  string
32

33
        URI *string // Optional
34
}
35

36
func (creds SharedKeyCredentials) azParams(
37
        containerName string,
38
) (containerURL string, azCreds *azblob.SharedKeyCredential, err error) {
×
39
        azCreds, err = azblob.NewSharedKeyCredential(creds.AccountName, creds.AccountKey)
×
40
        if err == nil {
×
41
                if creds.URI != nil {
×
42
                        containerURL = *creds.URI
×
43
                } else {
×
44
                        containerURL = fmt.Sprintf(
×
45
                                "https://%s.blob.core.windows.net/%s",
×
46
                                azCreds.AccountName(),
×
47
                                containerName,
×
48
                        )
×
49
                }
×
50
        }
51
        return containerURL, azCreds, err
×
52
}
53

54
type Options struct {
55
        ConnectionString *string
56
        SharedKey        *SharedKeyCredentials
57

58
        ProxyURI *url.URL
59

60
        BufferSize int64
61

62
        ContentType *string
63
}
64

65
func NewOptions(opts ...*Options) *Options {
1✔
66
        opt := &Options{
1✔
67
                BufferSize: BufferSizeDefault,
1✔
68
        }
1✔
69
        for _, o := range opts {
2✔
70
                if o == nil {
1✔
71
                        continue
×
72
                }
73
                if o.ConnectionString != nil {
1✔
74
                        opt.ConnectionString = o.ConnectionString
×
75
                }
×
76
                if o.SharedKey != nil {
1✔
77
                        opt.SharedKey = o.SharedKey
×
78
                }
×
79
                if o.ProxyURI != nil {
1✔
80
                        opt.ProxyURI = o.ProxyURI
×
81
                }
×
82
                if o.ContentType != nil {
2✔
83
                        opt.ContentType = o.ContentType
1✔
84
                }
1✔
85
                if o.BufferSize >= BufferSizeMin {
2✔
86
                        opt.BufferSize = o.BufferSize
1✔
87
                }
1✔
88
        }
89
        return opt
1✔
90
}
91

92
func (opts *Options) SetConnectionString(connStr string) *Options {
×
93
        opts.ConnectionString = &connStr
×
94
        return opts
×
95
}
×
96

97
func (opts *Options) SetSharedKey(sk SharedKeyCredentials) *Options {
×
98
        opts.SharedKey = &sk
×
99
        return opts
×
100
}
×
101

102
func (opts *Options) SetProxyURI(proxyURI *url.URL) *Options {
×
103
        opts.ProxyURI = proxyURI
×
104
        return opts
×
105
}
×
106

107
func (opts *Options) SetContentType(typ string) *Options {
1✔
108
        opts.ContentType = &typ
1✔
109
        return opts
1✔
110
}
1✔
111

112
func (opts *Options) SetBufferSize(size int64) *Options {
×
113
        opts.BufferSize = size
×
114
        return opts
×
115
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc