@@ -29,8 +29,8 @@ import (
29
29
"golang.org/x/crypto/openpgp"
30
30
)
31
31
32
- // IndexResource represent the index of the system
33
- type IndexResource struct {
32
+ // Resource represent the index of the system
33
+ type Resource struct {
34
34
LastRefresh time.Time // Last time the index was downloaded
35
35
IndexURL url.URL // The URL used to host the index.json
36
36
IndexFile paths.Path // The location of the index on the filesystem
@@ -42,7 +42,7 @@ var publicKeyHex string = "99020D0452FAA2FA011000D0C5604932111750628F171E4E612D5
42
42
43
43
// Init will initialize the IndexResource structure and will return it.
44
44
// It will take indexString as a paramenter.
45
- func Init (indexString string , directory * paths.Path ) * IndexResource {
45
+ func Init (indexString string , directory * paths.Path ) * Resource {
46
46
if directory == nil {
47
47
log .Fatalf ("configuration directory not provided" )
48
48
}
@@ -64,7 +64,7 @@ func Init(indexString string, directory *paths.Path) *IndexResource {
64
64
indexFile := path .Base (indexParsed .Path ) // == package_index.json
65
65
signatureFile := indexFile + ".sig"
66
66
67
- var ir = IndexResource {
67
+ var ir = Resource {
68
68
IndexURL : * indexParsed ,
69
69
IndexFile : * directory .Join (indexFile ),
70
70
IndexSignature : * directory .Join (signatureFile ),
@@ -82,7 +82,7 @@ func Init(indexString string, directory *paths.Path) *IndexResource {
82
82
83
83
// DownloadAndVerify will download an index file located at IndexURL and verify the signature
84
84
// if everything matches the files are overwritten
85
- func (ir * IndexResource ) DownloadAndVerify () error {
85
+ func (ir * Resource ) DownloadAndVerify () error {
86
86
// Fetch the index
87
87
resp , err := http .Get (ir .IndexURL .String ())
88
88
if err != nil {
0 commit comments