RobertIndie commented on code in PR #2437:
URL: https://github.com/apache/streampipes/pull/2437#discussion_r1534000794


##########
streampipes-client-go/streampipes/data_lake_measure_api.go:
##########
@@ -0,0 +1,180 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package streampipes
+
+import (
+       "github.com/apache/streampipes/streampipes-client-go/streampipes/config"
+       
"github.com/apache/streampipes/streampipes-client-go/streampipes/internal/serializer"
+       
"github.com/apache/streampipes/streampipes-client-go/streampipes/internal/util"
+       
"github.com/apache/streampipes/streampipes-client-go/streampipes/model/data_lake"
+       "io"
+       "log"
+       "net/http"
+)
+
+// DataLakeMeasure connects to the DataLakeMeasure endpoint of streamPipes.
+// DataLakeMeasure supports GET and DELETE to delete or obtain resources
+// The specific interaction behavior is provided by the method bound to the 
DataLakeMeasure struct.
+type DataLakeMeasure struct {
+       endpoint
+}
+
+func NewDataLakeMeasures(clientConfig config.StreamPipesClientConfig) 
*DataLakeMeasure {
+       // NewDataLakeMeasure is used to return an instance of *DataLakeMeasure,
+
+       return &DataLakeMeasure{
+               endpoint{config: clientConfig},
+       }
+}
+
+func (d *DataLakeMeasure) AllDataLakeMeasure() ([]data_lake.DataLakeMeasure, 
error) {
+       // Get a list of all measure
+
+       endPointUrl := util.NewStreamPipesApiPath(d.config.Url, 
"streampipes-backend/api/v4/datalake/measurements", nil)
+       log.Printf("Get data from: %s", endPointUrl)

Review Comment:
   We can use log.Info



##########
streampipes-client-go/streampipes/internal/serializer/deserializer.go:
##########
@@ -0,0 +1,76 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package serializer
+
+import (
+       "encoding/json"
+       
"github.com/apache/streampipes/streampipes-client-go/streampipes/model/data_lake"
+)
+
+type Deserializer interface {
+       GetUnmarshal(body []byte) (interface{}, error)
+}
+
+var _ Deserializer = (*UnmarshalDataLakeMeasures)(nil)
+var _ Deserializer = (*UnmarshalDataSeries)(nil)
+var _ Deserializer = (*UnmarshalDataLakeMeasure)(nil)
+
+type UnmarshalDataLakeMeasures struct{}

Review Comment:
   ```suggestion
   type DataLakeMeasuresDeserializer struct{}
   ```



##########
streampipes-client-go/streampipes/internal/serializer/deserializer.go:
##########
@@ -0,0 +1,76 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package serializer
+
+import (
+       "encoding/json"
+       
"github.com/apache/streampipes/streampipes-client-go/streampipes/model/data_lake"
+)
+
+type Deserializer interface {
+       GetUnmarshal(body []byte) (interface{}, error)
+}
+
+var _ Deserializer = (*UnmarshalDataLakeMeasures)(nil)
+var _ Deserializer = (*UnmarshalDataSeries)(nil)
+var _ Deserializer = (*UnmarshalDataLakeMeasure)(nil)
+
+type UnmarshalDataLakeMeasures struct{}
+
+func NewUnmarshalDataLakeMeasures() *UnmarshalDataLakeMeasures {
+       return &UnmarshalDataLakeMeasures{}
+}
+
+func (u *UnmarshalDataLakeMeasures) GetUnmarshal(data []byte) (interface{}, 
error) {

Review Comment:
   ```suggestion
   func (u *UnmarshalDataLakeMeasures) Unmarshal(data []byte) (interface{}, 
error) {
   ```



##########
streampipes-client-go/streampipes/data_lake_measure_api.go:
##########
@@ -0,0 +1,180 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements.  See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License.  You may obtain a copy of the License at
+//
+//    http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package streampipes
+
+import (
+       "github.com/apache/streampipes/streampipes-client-go/streampipes/config"
+       
"github.com/apache/streampipes/streampipes-client-go/streampipes/internal/serializer"
+       
"github.com/apache/streampipes/streampipes-client-go/streampipes/internal/util"
+       
"github.com/apache/streampipes/streampipes-client-go/streampipes/model/data_lake"
+       "io"
+       "log"
+       "net/http"
+)
+
+// DataLakeMeasure connects to the DataLakeMeasure endpoint of streamPipes.
+// DataLakeMeasure supports GET and DELETE to delete or obtain resources
+// The specific interaction behavior is provided by the method bound to the 
DataLakeMeasure struct.
+type DataLakeMeasure struct {
+       endpoint
+}
+
+func NewDataLakeMeasures(clientConfig config.StreamPipesClientConfig) 
*DataLakeMeasure {
+       // NewDataLakeMeasure is used to return an instance of *DataLakeMeasure,
+
+       return &DataLakeMeasure{
+               endpoint{config: clientConfig},
+       }
+}
+
+func (d *DataLakeMeasure) AllDataLakeMeasure() ([]data_lake.DataLakeMeasure, 
error) {
+       // Get a list of all measure

Review Comment:
   You can move this comment above the method name, so it can serve as the 
documentation for this method.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to