summaryrefslogtreecommitdiff
path: root/pkg/channelwriter/channelwriter.go
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2020-09-14 13:46:59 -0700
committerJhon Honce <jhonce@redhat.com>2020-09-14 13:46:59 -0700
commit146c68f3acdc01f393a6cfadf9bc98eec3e8de94 (patch)
tree4e6017e6b64d8fef0c2acb6cd0a3f13545f33b8f /pkg/channelwriter/channelwriter.go
parentfd7cdb25027bb33c33eacb99f1a02838eca5d684 (diff)
downloadpodman-146c68f3acdc01f393a6cfadf9bc98eec3e8de94.tar.gz
podman-146c68f3acdc01f393a6cfadf9bc98eec3e8de94.tar.bz2
podman-146c68f3acdc01f393a6cfadf9bc98eec3e8de94.zip
Refactor API build endpoint to be more compliant
* Refactor/Rename channel.WriteCloser() to encapsulate the channel * Refactor build endpoint to "live" stream buildah output channels over API rather then buffering output * Refactor bindings/tunnel build because endpoint changes * building tar file now in bindings rather then depending on caller * Cleanup initiating extra image engine * Remove setting fields to zero values (less noise in code) * Update tests to support remote builds Fixes #7136 Fixes #7137 Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'pkg/channelwriter/channelwriter.go')
-rw-r--r--pkg/channelwriter/channelwriter.go34
1 files changed, 0 insertions, 34 deletions
diff --git a/pkg/channelwriter/channelwriter.go b/pkg/channelwriter/channelwriter.go
deleted file mode 100644
index d51400eb3..000000000
--- a/pkg/channelwriter/channelwriter.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package channelwriter
-
-import "github.com/pkg/errors"
-
-// Writer is an io.writer-like object that "writes" to a channel
-// instead of a buffer or file, etc. It is handy for varlink endpoints when
-// needing to handle endpoints that do logging "real-time"
-type Writer struct {
- ByteChannel chan []byte
-}
-
-// NewChannelWriter creates a new channel writer and adds a
-// byte slice channel into it.
-func NewChannelWriter() *Writer {
- byteChannel := make(chan []byte)
- return &Writer{
- ByteChannel: byteChannel,
- }
-}
-
-// Write method for Writer
-func (c *Writer) Write(w []byte) (int, error) {
- if c.ByteChannel == nil {
- return 0, errors.New("channel writer channel cannot be nil")
- }
- c.ByteChannel <- w
- return len(w), nil
-}
-
-// Close method for Writer
-func (c *Writer) Close() error {
- close(c.ByteChannel)
- return nil
-}