Skip to content

Commit f7c875e

Browse files
committed
rename to Resource
1 parent 52a9c4c commit f7c875e

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

index/index.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -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 {

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ var homeTemplateHTML string
9999
var (
100100
Tools tools.Tools
101101
Systray systray.Systray
102-
Index *index.IndexResource
102+
Index *index.Resource
103103
)
104104

105105
type logWriter struct{}

tools/tools.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import (
4848
// Tools will represent the installed tools
4949
type Tools struct {
5050
Directory string
51-
Index *index.IndexResource
51+
Index *index.Resource
5252
Logger func(msg string)
5353
installed map[string]string
5454
mutex sync.RWMutex

v2/http.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131
)
3232

3333
// Server is the actual server
34-
func Server(directory string, index *index.IndexResource) http.Handler {
34+
func Server(directory string, index *index.Resource) http.Handler {
3535
mux := goahttp.NewMuxer()
3636

3737
// Instantiate logger

v2/pkgs/tools.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ import (
5151
//
5252
// It requires an Index Resource to search for tools
5353
type Tools struct {
54-
Index *index.IndexResource
54+
Index *index.Resource
5555
Folder string
5656
}
5757

0 commit comments

Comments
 (0)