@@ -29,8 +29,8 @@ import (
2929 "golang.org/x/crypto/openpgp"
3030)
3131
32- // IndexResource represent the index of the system
33- type IndexResource struct {
32+ // Resource represent the index of the system
33+ type Resource struct {
3434 LastRefresh time.Time // Last time the index was downloaded
3535 IndexURL url.URL // The URL used to host the index.json
3636 IndexFile paths.Path // The location of the index on the filesystem
@@ -42,7 +42,7 @@ var publicKeyHex string = "99020D0452FAA2FA011000D0C5604932111750628F171E4E612D5
4242
4343// Init will initialize the IndexResource structure and will return it.
4444// 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 {
4646 if directory == nil {
4747 log .Fatalf ("configuration directory not provided" )
4848 }
@@ -64,7 +64,7 @@ func Init(indexString string, directory *paths.Path) *IndexResource {
6464 indexFile := path .Base (indexParsed .Path ) // == package_index.json
6565 signatureFile := indexFile + ".sig"
6666
67- var ir = IndexResource {
67+ var ir = Resource {
6868 IndexURL : * indexParsed ,
6969 IndexFile : * directory .Join (indexFile ),
7070 IndexSignature : * directory .Join (signatureFile ),
@@ -82,7 +82,7 @@ func Init(indexString string, directory *paths.Path) *IndexResource {
8282
8383// DownloadAndVerify will download an index file located at IndexURL and verify the signature
8484// if everything matches the files are overwritten
85- func (ir * IndexResource ) DownloadAndVerify () error {
85+ func (ir * Resource ) DownloadAndVerify () error {
8686 // Fetch the index
8787 resp , err := http .Get (ir .IndexURL .String ())
8888 if err != nil {
0 commit comments