Skip to content

Commit d62c12f

Browse files
committed
added comments
1 parent d32d3f3 commit d62c12f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drone/artifact.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ import (
1313
"path/filepath"
1414
)
1515

16+
// Type of registry
1617
type RegistryType string
1718

19+
// Registries const
1820
const (
1921
Docker RegistryType = "Docker"
2022
ECR RegistryType = "ECR"
@@ -27,22 +29,26 @@ const (
2729
)
2830

2931
type (
32+
// Image stores the image data
3033
Image struct {
3134
Image string `json:"image"`
3235
Digest string `json:"digest"`
3336
}
37+
// Date stores the registry data
3438
Data struct {
3539
RegistryType RegistryType `json:"registryType"`
3640
RegistryUrl string `json:"registryUrl"`
3741
Images []Image `json:"images"`
3842
}
43+
// DockerArtifact is the current artifact
3944
DockerArtifact struct {
4045
Kind string `json:"kind"`
4146
Data Data `json:"data"`
4247
}
4348
)
4449

45-
func WritePluginArtifactFile(registryType RegistryType, artifactFilePath, registryUrl, imageName, digest string, tags []string) error {
50+
// WritePluginArtifactFile writes the docker artifact data to the provided artifact file
51+
func WritePluginArtifactFile(registryType RegistryType, artifactFilePath, registryURL, imageName, digest string, tags []string) error {
4652
var images []Image
4753
for _, tag := range tags {
4854
images = append(images, Image{
@@ -52,7 +58,7 @@ func WritePluginArtifactFile(registryType RegistryType, artifactFilePath, regist
5258
}
5359
data := Data{
5460
RegistryType: registryType,
55-
RegistryUrl: registryUrl,
61+
RegistryUrl: registryURL,
5662
Images: images,
5763
}
5864

0 commit comments

Comments
 (0)