Rename TimeSyncStatus() to TimeSynced() for API clarity

This commit is contained in:
wpetit 2018-09-20 11:36:48 +02:00
parent 6534c51fe4
commit 13267b2d5a
3 changed files with 5 additions and 4 deletions

View File

@ -113,7 +113,7 @@ func updateThenReboot() {
defer updater.Close()
log.Println("checking time sync")
synced, err := updater.TimeSyncStatus()
synced, err := updater.TimeSynced()
if err != nil {
log.Fatal(err)
}

View File

@ -16,8 +16,9 @@ type timeSyncStatus struct {
Status bool `json:"status"`
}
// TimeSyncStatus returns the ReachRS module time sync status
func (u *Updater) TimeSyncStatus() (bool, error) {
// TimeSynced returns the ReachRS module time synchronization status.
// A true response means that the module has synchronized its clock.
func (u *Updater) TimeSynced() (bool, error) {
var err error
var synced bool

View File

@ -18,7 +18,7 @@ func TestClientTimeSync(t *testing.T) {
t.Fatal(err)
}
_, err := client.TimeSyncStatus()
_, err := client.TimeSynced()
if err != nil {
t.Error(err)
}