jrmccluskey commented on a change in pull request #15253:
URL: https://github.com/apache/beam/pull/15253#discussion_r680164222



##########
File path: sdks/go/pkg/beam/testing/teststream/teststream.go
##########
@@ -0,0 +1,131 @@
+// 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 teststream contains code configuring the TestStream primitive for
+// use in testing code that is meant to be run on streaming data sources.
+// TestStream is not supported on the Go direct runner.
+package teststream
+
+import (
+       "bytes"
+       "fmt"
+
+       "github.com/apache/beam/sdks/go/pkg/beam"
+       "github.com/apache/beam/sdks/go/pkg/beam/core/graph/coder"
+       "github.com/apache/beam/sdks/go/pkg/beam/core/graph/mtime"
+       "github.com/apache/beam/sdks/go/pkg/beam/core/util/protox"
+
+       pipepb "github.com/apache/beam/sdks/go/pkg/beam/model/pipeline_v1"
+)
+
+const urn = "beam:transform:teststream:v1"
+
+// Config holds information used to create a TestStreamPayload object.
+type Config struct {
+       ElmCoder  *coder.Coder
+       Events    []*pipepb.TestStreamPayload_Event
+       Endpoint  *pipepb.ApiServiceDescriptor
+       Watermark int64
+}
+
+// MakeConfig initializes a Config struct to begin inserting TestStream 
events/endpoints into.
+// Requires that users provide the coder for the elements they are trying to 
emit.
+func MakeConfig(c *coder.Coder) Config {

Review comment:
       Changed NewConfig() to not take any arguments, handle assigning the 
coder when elements are added. 
   
   Assuming we allow users to provide custom coders through a SetCoder method, 
how would we validate that the new coder can encode everything the previous 
coder could?




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