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) }