Skip to content

Commit 797a1e1

Browse files
committed
Address review comment and upgrade the embedded client
1 parent d111252 commit 797a1e1

File tree

4 files changed

+27
-21
lines changed

4 files changed

+27
-21
lines changed

utils/artefacts/artefacts.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ const relativePathKey = "Relative Path"
2828

2929
type (
3030
// GetArtefactManagersFirstPageFunc defines the function which can retrieve the first page of artefact managers.
31-
GetArtefactManagersFirstPageFunc[D LinkData, L Links[D], C Collection[D, L]] = func(ctx context.Context, job string) (C, *http.Response, error)
31+
GetArtefactManagersFirstPageFunc[D ILinkData, L ILinks[D], C ICollection[D, L]] = func(ctx context.Context, job string) (C, *http.Response, error)
3232
// FollowLinkToArtefactManagersPageFunc is a function able to follow a link to an artefact manager page.
33-
FollowLinkToArtefactManagersPageFunc[D LinkData, L Links[D], C Collection[D, L]] = func(ctx context.Context, link D) (C, *http.Response, error)
33+
FollowLinkToArtefactManagersPageFunc[D ILinkData, L ILinks[D], C ICollection[D, L]] = func(ctx context.Context, link D) (C, *http.Response, error)
3434
// GetArtefactManagerFunc is a function which retrieves information about an artefact manager.
35-
GetArtefactManagerFunc[M Manager] = func(ctx context.Context, job, artefact string) (M, *http.Response, error)
35+
GetArtefactManagerFunc[M IManager] = func(ctx context.Context, job, artefact string) (M, *http.Response, error)
3636
// GetArtefactContentFunc is a function able to return the content of any artefact managers.
3737
GetArtefactContentFunc = func(ctx context.Context, job, artefactID string) (*os.File, *http.Response, error)
3838
)
3939

40-
func determineArtefactDestination[M Manager](outputDir string, maintainTree bool, item M) (artefactFileName string, destinationDir string, err error) {
40+
func determineArtefactDestination[M IManager](outputDir string, maintainTree bool, item M) (artefactFileName string, destinationDir string, err error) {
4141
if any(item) == nil {
4242
err = fmt.Errorf("%w: missing artefact item", commonerrors.ErrUndefined)
4343
return
@@ -76,10 +76,10 @@ func determineArtefactDestination[M Manager](outputDir string, maintainTree bool
7676
}
7777

7878
type ArtefactManager[
79-
M Manager,
80-
D LinkData,
81-
L Links[D],
82-
C Collection[D, L],
79+
M IManager,
80+
D ILinkData,
81+
L ILinks[D],
82+
C ICollection[D, L],
8383
] struct {
8484
getArtefactManagerFunc GetArtefactManagerFunc[M]
8585
getArtefactContentFunc GetArtefactContentFunc
@@ -89,10 +89,10 @@ type ArtefactManager[
8989

9090
// NewArtefactManager returns an artefact manager.
9191
func NewArtefactManager[
92-
M Manager,
93-
D LinkData,
94-
L Links[D],
95-
C Collection[D, L],
92+
M IManager,
93+
D ILinkData,
94+
L ILinks[D],
95+
C ICollection[D, L],
9696
](
9797
getArtefactManagersFirstPage GetArtefactManagersFirstPageFunc[D, L, C],
9898
getArtefactsManagersPage FollowLinkToArtefactManagersPageFunc[D, L, C],

utils/artefacts/interface.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import (
1414
//go:generate mockgen -destination=../mocks/mock_$GOPACKAGE.go -package=mocks github.com/ARM-software/embedded-development-services-client-utils/utils/$GOPACKAGE IArtefactManager
1515

1616
type IArtefactManager[
17-
M Manager,
18-
D LinkData,
17+
M IManager,
18+
D ILinkData,
1919
] interface {
2020
// DownloadJobArtefactFromLink downloads a specific artefact into the output directory from a particular link. The artefact will be placed at the root of the output directory.
2121
DownloadJobArtefactFromLink(ctx context.Context, jobName string, outputDirectory string, artefactManagerItemLink D) error
@@ -36,24 +36,24 @@ type IArtefactManager[
3636
DownloadAllJobArtefactsWithTree(ctx context.Context, jobName string, maintainTreeStructure bool, outputDirectory string) error
3737
}
3838

39-
type LinkData interface {
39+
type ILinkData interface {
4040
comparable
4141
GetName() string
4242
GetHref() string
4343
}
4444

45-
type Links[D LinkData] interface {
45+
type ILinks[D ILinkData] interface {
4646
comparable
4747
GetNextP() D
4848
HasNext() bool
4949
}
50-
type Collection[D LinkData, L Links[D]] interface {
50+
type ICollection[D ILinkData, L ILinks[D]] interface {
5151
comparable
5252
pagination.IStaticPage
5353
GetLinksOk() (L, bool)
5454
}
5555

56-
type Manager interface {
56+
type IManager interface {
5757
comparable
5858
GetName() string
5959
GetTitle() string

utils/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ module github.com/ARM-software/embedded-development-services-client-utils/utils
33
go 1.24
44

55
require (
6-
github.com/ARM-software/embedded-development-services-client/client v1.45.1
6+
github.com/ARM-software/embedded-development-services-client/client v1.50.0
77
github.com/ARM-software/golang-utils/utils v1.89.0
88
github.com/go-faker/faker/v4 v4.6.0
99
github.com/go-logr/logr v1.4.2
1010
github.com/stretchr/testify v1.10.0
1111
go.uber.org/atomic v1.11.0
1212
go.uber.org/goleak v1.3.0
1313
go.uber.org/mock v0.5.0
14-
golang.org/x/sync v0.12.0
14+
golang.org/x/sync v0.13.0
1515
)
1616

1717
require (
@@ -76,7 +76,7 @@ require (
7676
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect
7777
golang.org/x/oauth2 v0.28.0 // indirect
7878
golang.org/x/sys v0.31.0 // indirect
79-
golang.org/x/text v0.23.0 // indirect
79+
golang.org/x/text v0.24.0 // indirect
8080
gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 // indirect
8181
gopkg.in/yaml.v3 v3.0.1 // indirect
8282
)

utils/go.sum

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
bitbucket.org/creachadair/stringset v0.0.9/go.mod h1:t+4WcQ4+PXTa8aQdNKe40ZP6iwesoMFWAxPGd3UGjyY=
22
github.com/ARM-software/embedded-development-services-client/client v1.45.1 h1:qB/nQm3RtVTLbPXI1BNH8RC8T0Bw06PJPY2geRKTpuw=
33
github.com/ARM-software/embedded-development-services-client/client v1.45.1/go.mod h1:rQp94BDHwu/+Q27cwS8iObzaJW027hMTRpN5Jj+6Ddc=
4+
github.com/ARM-software/embedded-development-services-client/client v1.50.0 h1:6woKXzWh0XUlBGA2El5XhaW6FY9QxtvQ7Lhkjp+Yi8g=
5+
github.com/ARM-software/embedded-development-services-client/client v1.50.0/go.mod h1:I4n0SrcIgKKVbcJCBBwvANNz+Wjs/EZ9YwzIiFe4fsk=
46
github.com/ARM-software/golang-utils/utils v1.89.0 h1:WyrZiTkzzHemZ4oqS/LbkjukDYyV7TCS1efAT9rmB4A=
57
github.com/ARM-software/golang-utils/utils v1.89.0/go.mod h1:hbOnHpp3NKGQlSwI8YhIBLH5TrlPnFP3OE0HphMNqVI=
68
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
@@ -222,6 +224,8 @@ golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT
222224
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
223225
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
224226
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
227+
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
228+
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
225229
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
226230
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
227231
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -257,6 +261,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
257261
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
258262
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
259263
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
264+
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
265+
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
260266
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
261267
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
262268
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

0 commit comments

Comments
 (0)