summaryrefslogtreecommitdiff
path: root/src/hub
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2017-04-29 19:24:42 +0200
committerChristian Pointner <equinox@spreadspace.org>2017-04-29 19:24:42 +0200
commitdcc49507bfed610ffb47400bb30a1acbc99daba6 (patch)
tree7ea9fdf242714bc4e9b6412b11d1fc1dcbbb0208 /src/hub
parentuse printable characters for itob/btoi (diff)
minor refactoring
Diffstat (limited to 'src/hub')
-rw-r--r--src/hub/src/spreadspace.org/sfive/s5srvWeb.go4
-rw-r--r--src/hub/src/spreadspace.org/sfive/s5store_test.go6
-rw-r--r--src/hub/src/spreadspace.org/sfive/s5typesApi.go14
3 files changed, 12 insertions, 12 deletions
diff --git a/src/hub/src/spreadspace.org/sfive/s5srvWeb.go b/src/hub/src/spreadspace.org/sfive/s5srvWeb.go
index 1a16515..8ecb673 100644
--- a/src/hub/src/spreadspace.org/sfive/s5srvWeb.go
+++ b/src/hub/src/spreadspace.org/sfive/s5srvWeb.go
@@ -55,7 +55,7 @@ func (srv Server) webGetSourcesList(c web.C, w http.ResponseWriter, r *http.Requ
http.Error(w, fmt.Sprintf("failed to retrieve %s: %v", resourceName, err), http.StatusInternalServerError)
return
}
- jsonString, err := json.Marshal(DataContainer{values})
+ jsonString, err := json.Marshal(GenericDataContainer{values})
if err != nil {
http.Error(w, fmt.Sprintf("failed to marshal %s: %v", resourceName, err), http.StatusInternalServerError)
return
@@ -94,7 +94,7 @@ func (srv Server) webGetUpdateList(c web.C, w http.ResponseWriter, r *http.Reque
http.Error(w, fmt.Sprintf("failed to retrieve %s: %v", resourceName, err), http.StatusInternalServerError)
return
}
- jsonString, err := json.Marshal(DataContainer{values})
+ jsonString, err := json.Marshal(GenericDataContainer{values})
if err != nil {
http.Error(w, fmt.Sprintf("failed to marshal %s: %v", resourceName, err), http.StatusInternalServerError)
return
diff --git a/src/hub/src/spreadspace.org/sfive/s5store_test.go b/src/hub/src/spreadspace.org/sfive/s5store_test.go
index c78de6b..481b189 100644
--- a/src/hub/src/spreadspace.org/sfive/s5store_test.go
+++ b/src/hub/src/spreadspace.org/sfive/s5store_test.go
@@ -40,6 +40,12 @@ import (
"time"
)
+const (
+ QualityLow = "low"
+ QualityMedium = "medium"
+ QualityHigh = "high"
+)
+
var (
__boltPath = "/run/s5hub_testing_db.bolt"
)
diff --git a/src/hub/src/spreadspace.org/sfive/s5typesApi.go b/src/hub/src/spreadspace.org/sfive/s5typesApi.go
index 8b214a8..233659a 100644
--- a/src/hub/src/spreadspace.org/sfive/s5typesApi.go
+++ b/src/hub/src/spreadspace.org/sfive/s5typesApi.go
@@ -34,12 +34,6 @@ package sfive
import "time"
-const (
- QualityLow = "low"
- QualityMedium = "medium"
- QualityHigh = "high"
-)
-
type StreamId struct {
ContentId string `json:"content-id"`
Format string `json:"format"`
@@ -79,10 +73,6 @@ type DataUpdateFull struct {
DataUpdate
}
-type DataContainer struct {
- Data interface{} `json:"data"`
-}
-
type DataUpdateFullContainer struct {
Data []DataUpdateFull `json:"data"`
}
@@ -99,3 +89,7 @@ func (duf *DataUpdateFull) CopyFromUpdate(du *DataUpdate) {
duf.Duration = du.Duration
duf.Data = du.Data
}
+
+type GenericDataContainer struct {
+ Data interface{} `json:"data"`
+}