From 403e14c3206db9b92f2bc122559f205117a4cdf8 Mon Sep 17 00:00:00 2001 From: William Petit Date: Wed, 19 Sep 2018 17:24:50 +0200 Subject: [PATCH] Rename OPKGUpdate() to Update() --- reach/{opkg_update.go => update.go} | 12 ++++++------ reach/{opkg_update_test.go => update_test.go} | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) rename reach/{opkg_update.go => update.go} (77%) rename reach/{opkg_update_test.go => update_test.go} (78%) diff --git a/reach/opkg_update.go b/reach/update.go similarity index 77% rename from reach/opkg_update.go rename to reach/update.go index a200821..1d078a3 100644 --- a/reach/opkg_update.go +++ b/reach/update.go @@ -12,23 +12,23 @@ const ( eventOPKGUpdateResult = "opkg update result" ) -// OPKGUpdateStatus embeds informations about OPKG update status -type OPKGUpdateStatus struct { +// UpdateStatus embeds informations about update status +type UpdateStatus struct { Active bool `json:"active"` State string `json:"state"` Locked bool `json:"locked"` } -// OPKGUpdate asks the ReachRS module to start an OPKG update -func (u *Updater) OPKGUpdate() (*OPKGUpdateStatus, error) { +// Update asks the ReachRS module to start an OPKG update +func (u *Updater) Update() (*UpdateStatus, error) { var err error - var status *OPKGUpdateStatus + var status *UpdateStatus var wg sync.WaitGroup wg.Add(1) - err = u.conn.On(eventOPKGUpdateResult, func(h *gosocketio.Channel, st *OPKGUpdateStatus) { + err = u.conn.On(eventOPKGUpdateResult, func(h *gosocketio.Channel, st *UpdateStatus) { status = st u.conn.Off(eventOPKGUpdateResult) wg.Done() diff --git a/reach/opkg_update_test.go b/reach/update_test.go similarity index 78% rename from reach/opkg_update_test.go rename to reach/update_test.go index b77749e..87161e4 100644 --- a/reach/opkg_update_test.go +++ b/reach/update_test.go @@ -7,7 +7,7 @@ import ( func TestClientOPKGUpdate(t *testing.T) { if !*runUpdaterIntegrationTests { - t.Skip("To run this test, use: go test -integration") + t.Skip("To run this test, use: go test -updater-integration") } client := NewUpdaterClient( @@ -18,7 +18,7 @@ func TestClientOPKGUpdate(t *testing.T) { t.Fatal(err) } - _, err := client.OPKGUpdate() + _, err := client.Update() if err != nil { t.Error(err) }