Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions internal/api/api_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ import (
"github.com/OpenCHAMI/power-control/v2/internal/model"
)

type IDList struct {
IDs []uuid.UUID `json:"ids"`
}

type IDResp struct {
ID uuid.UUID `json:"id"`
}

// WriteJSON - writes JSON to the open http connection
func WriteJSON(w http.ResponseWriter, i interface{}) {
obj, err := json.Marshal(i)
Expand All @@ -57,9 +65,9 @@ func WriteHeaders(w http.ResponseWriter, pb model.Passback) {
w.WriteHeader(pb.StatusCode)
switch val := pb.Obj.(type) {
case []uuid.UUID:
WriteJSON(w, model.IDList{IDs: val})
WriteJSON(w, IDList{IDs: val})
case uuid.UUID:
WriteJSON(w, model.IDResp{ID: val})
WriteJSON(w, IDResp{ID: val})
default:
WriteJSON(w, pb.Obj)
}
Expand Down
47 changes: 0 additions & 47 deletions internal/api/api_test_setup_handler.go

This file was deleted.

97 changes: 0 additions & 97 deletions internal/model/models.go

This file was deleted.

70 changes: 0 additions & 70 deletions internal/model/models_test.go

This file was deleted.

23 changes: 0 additions & 23 deletions internal/storage/power_status.go

This file was deleted.

4 changes: 2 additions & 2 deletions internal/storage/transition_size_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ func createProviders(t *testing.T, settings *EtcdTestSettings) (StorageProvider,
t.Errorf("Storage Init() failed: %v", err)
}

err = ds.Init(nil)
ds.Init(nil)
if err != nil {
t.Errorf("DistributedLockProvider Init() failed: %v", err)
t.Errorf("DistLock Init() failed: %v", err)
}

if e, ok := ms.(*ETCDStorage); ok {
Expand Down