github.com/ungtb10d/cli/v2@v2.0.0-20221110210412-98537dd9d6a1/internal/codespaces/grpc/test/channel.go (about)

     1  package test
     2  
     3  import (
     4  	"io"
     5  	"net"
     6  )
     7  
     8  type Channel struct {
     9  	conn net.Conn
    10  }
    11  
    12  func (c *Channel) Read(data []byte) (int, error) {
    13  	return c.conn.Read(data)
    14  }
    15  
    16  func (c *Channel) Write(data []byte) (int, error) {
    17  	return c.conn.Write(data)
    18  }
    19  
    20  func (c *Channel) Close() error {
    21  	return c.conn.Close()
    22  }
    23  
    24  func (c *Channel) CloseWrite() error {
    25  	return nil
    26  }
    27  
    28  func (c *Channel) SendRequest(name string, wantReply bool, payload []byte) (bool, error) {
    29  	return false, nil
    30  }
    31  
    32  func (c *Channel) Stderr() io.ReadWriter {
    33  	return nil
    34  }