wy-os commented on code in PR #2437:
URL: https://github.com/apache/streampipes/pull/2437#discussion_r1531469907


##########
streampipes-client-go/streampipes/data_lake_measure_api.go:
##########
@@ -0,0 +1,194 @@
+//
+// 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 (
+       "errors"
+       "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([]string{d.config.Url}).FromStreamPipesBasePath().AddToPath([]string{"api",
 "v4", "datalake", "measurements"}).String()

Review Comment:
   You have a point, but the basic call chain is not recommended for change. 
FromStreamPipesBasePath concatenates a "streampipes-backend", which is not 
common to every api. AddToPath is designed to support parametric queries in the 
future, but for now I can change it to something like this:
   
`util.NewStreamPipesApiPath([]string{d.config.Url}).FromStreamPipesBasePath().AddToPath([]string{"api/v4/datalake/measurements"})`
   For other methods that require passed arguments, such as 
GetSingleDataLakeMeasure, need to concatenate the passed arguments



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