func (s *OpenAppendOutWebsocketStream) Done() error {
	return s.stream.Done()
}
Done closes the request stream and should be called after all arguments have been written.
package common
import (
	"fmt"
	"net/http"
	"reflect"
	"github.com/uber/cherami-client-go/common"
	"github.com/uber/cherami-client-go/common/websocket"
	"github.com/uber/cherami-client-go/stream"
	serverStream "github.com/uber/cherami-server/stream"
	"github.com/uber/cherami-thrift/.generated/go/cherami"
	"github.com/uber/cherami-thrift/.generated/go/store"
)
type (
	WSConnector interface {
		OpenPublisherStream(hostPort string, requestHeader http.Header) (stream.BInOpenPublisherStreamOutCall, error)
		AcceptPublisherStream(w http.ResponseWriter, r *http.Request) (serverStream.BInOpenPublisherStreamInCall, error)
		OpenConsumerStream(hostPort string, requestHeader http.Header) (stream.BOutOpenConsumerStreamOutCall, error)
		AcceptConsumerStream(w http.ResponseWriter, r *http.Request) (serverStream.BOutOpenConsumerStreamInCall, error)
		OpenAppendStream(hostPort string, requestHeader http.Header) (serverStream.BStoreOpenAppendStreamOutCall, error)
		AcceptAppendStream(w http.ResponseWriter, r *http.Request) (serverStream.BStoreOpenAppendStreamInCall, error)
		OpenReadStream(hostPort string, requestHeader http.Header) (serverStream.BStoreOpenReadStreamOutCall, error)
		AcceptReadStream(w http.ResponseWriter, r *http.Request) (serverStream.BStoreOpenReadStreamInCall, error)
		OpenReplicationReadStream(hostPort string, requestHeader http.Header) (serverStream.BStoreOpenReadStreamOutCall, error)
		AcceptReplicationReadStream(w http.ResponseWriter, r *http.Request) (serverStream.BStoreOpenReadStreamInCall, error)
		OpenReplicationRemoteReadStream(hostPort string, requestHeader http.Header) (serverStream.BStoreOpenReadStreamOutCall, error)
		AcceptReplicationRemoteReadStream(w http.ResponseWriter, r *http.Request) (serverStream.BStoreOpenReadStreamInCall, error)
	}
	wsConnectorImpl struct {
		wsHub websocket.Hub
		openPublisherOutStreamReadType reflect.Type
		openPublisherInStreamReadType  reflect.Type
		openConsumerOutStreamReadType  reflect.Type
		openConsumerInStreamReadType   reflect.Type
		openAppendOutStreamReadType    reflect.Type
		openAppendInStreamReadType     reflect.Type
		openReadOutStreamReadType      reflect.Type
		openReadInStreamReadType       reflect.Type
	}
	OpenPublisherOutWebsocketStream struct {
		stream websocket.StreamClient
	}
	OpenPublisherInWebsocketStream struct {
		stream websocket.StreamServer
	}
	OpenConsumerOutWebsocketStream struct {
		stream websocket.StreamClient
	}
	OpenConsumerInWebsocketStream struct {
		stream websocket.StreamServer
	}
	OpenAppendOutWebsocketStream struct {
		stream websocket.StreamClient
	}
	OpenAppendInWebsocketStream struct {
		stream websocket.StreamServer
	}
	OpenReadOutWebsocketStream struct {
		stream websocket.StreamClient
	}
	OpenReadInWebsocketStream struct {
		stream websocket.StreamServer
	}
)
var _ WSConnector = (*wsConnectorImpl)(nil)
var _ stream.BInOpenPublisherStreamOutCall = (*OpenPublisherOutWebsocketStream)(nil)
var _ serverStream.BInOpenPublisherStreamInCall = (*OpenPublisherInWebsocketStream)(nil)
var _ stream.BOutOpenConsumerStreamOutCall = (*OpenConsumerOutWebsocketStream)(nil)
var _ serverStream.BOutOpenConsumerStreamInCall = (*OpenConsumerInWebsocketStream)(nil)
var _ serverStream.BStoreOpenAppendStreamOutCall = (*OpenAppendOutWebsocketStream)(nil)
var _ serverStream.BStoreOpenAppendStreamInCall = (*OpenAppendInWebsocketStream)(nil)
var _ serverStream.BStoreOpenReadStreamOutCall = (*OpenReadOutWebsocketStream)(nil)
var _ serverStream.BStoreOpenReadStreamInCall = (*OpenReadInWebsocketStream)(nil)
func NewWSConnector() WSConnector {
	return &wsConnectorImpl{
		wsHub: websocket.NewWebsocketHub(),
		openPublisherOutStreamReadType: reflect.TypeOf((*cherami.InputHostCommand)(nil)).Elem(),
		openPublisherInStreamReadType:  reflect.TypeOf((*cherami.PutMessage)(nil)).Elem(),
		openConsumerOutStreamReadType:  reflect.TypeOf((*cherami.OutputHostCommand)(nil)).Elem(),
		openConsumerInStreamReadType:   reflect.TypeOf((*cherami.ControlFlow)(nil)).Elem(),
		openAppendOutStreamReadType:    reflect.TypeOf((*store.AppendMessageAck)(nil)).Elem(),
		openAppendInStreamReadType:     reflect.TypeOf((*store.AppendMessage)(nil)).Elem(),
		openReadOutStreamReadType:      reflect.TypeOf((*store.ReadMessageContent)(nil)).Elem(),
		openReadInStreamReadType:       reflect.TypeOf((*cherami.ControlFlow)(nil)).Elem(),
	}
}
func (c *wsConnectorImpl) OpenPublisherStream(hostPort string, requestHeader http.Header) (stream.BInOpenPublisherStreamOutCall, error) {
	url := fmt.Sprintf(common.WSUrlFormat, hostPort, common.EndpointOpenPublisherStream)
	stream := websocket.NewStreamClient(url, requestHeader, c.wsHub, c.openPublisherOutStreamReadType)
	if err := stream.Start(); err != nil {
		return nil, err
	}
	return NewOpenPublisherOutWebsocketStream(stream), nil
}
func (c *wsConnectorImpl) AcceptPublisherStream(w http.ResponseWriter, r *http.Request) (serverStream.BInOpenPublisherStreamInCall, error) {
	stream := websocket.NewStreamServer(w, r, c.wsHub, c.openPublisherInStreamReadType)
	if err := stream.Start(); err != nil {
		return nil, err
	}
	return NewOpenPublisherInWebsocketStream(stream), nil
}
func (c *wsConnectorImpl) OpenConsumerStream(hostPort string, requestHeader http.Header) (stream.BOutOpenConsumerStreamOutCall, error) {
	url := fmt.Sprintf(common.WSUrlFormat, hostPort, common.EndpointOpenConsumerStream)
	stream := websocket.NewStreamClient(url, requestHeader, c.wsHub, c.openConsumerOutStreamReadType)
	if err := stream.Start(); err != nil {
		return nil, err
	}
	return NewOpenConsumerOutWebsocketStream(stream), nil
}
func (c *wsConnectorImpl) AcceptConsumerStream(w http.ResponseWriter, r *http.Request) (serverStream.BOutOpenConsumerStreamInCall, error) {
	stream := websocket.NewStreamServer(w, r, c.wsHub, c.openConsumerInStreamReadType)
	if err := stream.Start(); err != nil {
		return nil, err
	}
	return NewOpenConsumerInWebsocketStream(stream), nil
}
func (c *wsConnectorImpl) OpenAppendStream(hostPort string, requestHeader http.Header) (serverStream.BStoreOpenAppendStreamOutCall, error) {
	url := fmt.Sprintf(common.WSUrlFormat, hostPort, common.EndpointOpenAppendStream)
	stream := websocket.NewStreamClient(url, requestHeader, c.wsHub, c.openAppendOutStreamReadType)
	if err := stream.Start(); err != nil {
		return nil, err
	}
	return NewOpenAppendOutWebsocketStream(stream), nil
}
func (c *wsConnectorImpl) AcceptAppendStream(w http.ResponseWriter, r *http.Request) (serverStream.BStoreOpenAppendStreamInCall, error) {
	stream := websocket.NewStreamServer(w, r, c.wsHub, c.openAppendInStreamReadType)
	if err := stream.Start(); err != nil {
		return nil, err
	}
	return NewOpenAppendInWebsocketStream(stream), nil
}
func (c *wsConnectorImpl) OpenReadStream(hostPort string, requestHeader http.Header) (serverStream.BStoreOpenReadStreamOutCall, error) {
	url := fmt.Sprintf(common.WSUrlFormat, hostPort, common.EndpointOpenReadStream)
	stream := websocket.NewStreamClient(url, requestHeader, c.wsHub, c.openReadOutStreamReadType)
	if err := stream.Start(); err != nil {
		return nil, err
	}
	return NewOpenReadOutWebsocketStream(stream), nil
}
func (c *wsConnectorImpl) AcceptReadStream(w http.ResponseWriter, r *http.Request) (serverStream.BStoreOpenReadStreamInCall, error) {
	stream := websocket.NewStreamServer(w, r, c.wsHub, c.openReadInStreamReadType)
	if err := stream.Start(); err != nil {
		return nil, err
	}
	return NewOpenReadInWebsocketStream(stream), nil
}
func (c *wsConnectorImpl) OpenReplicationReadStream(hostPort string, requestHeader http.Header) (serverStream.BStoreOpenReadStreamOutCall, error) {
	url := fmt.Sprintf(common.WSUrlFormat, hostPort, common.EndpointOpenReplicationReadStream)
	stream := websocket.NewStreamClient(url, requestHeader, c.wsHub, c.openReadOutStreamReadType)
	if err := stream.Start(); err != nil {
		return nil, err
	}
	return NewOpenReadOutWebsocketStream(stream), nil
}
func (c *wsConnectorImpl) AcceptReplicationReadStream(w http.ResponseWriter, r *http.Request) (serverStream.BStoreOpenReadStreamInCall, error) {
	stream := websocket.NewStreamServer(w, r, c.wsHub, c.openReadInStreamReadType)
	if err := stream.Start(); err != nil {
		return nil, err
	}
	return NewOpenReadInWebsocketStream(stream), nil
}
func (c *wsConnectorImpl) OpenReplicationRemoteReadStream(hostPort string, requestHeader http.Header) (serverStream.BStoreOpenReadStreamOutCall, error) {
	url := fmt.Sprintf(common.WSUrlFormat, hostPort, common.EndpointOpenReplicationRemoteReadStream)
	stream := websocket.NewStreamClient(url, requestHeader, c.wsHub, c.openReadOutStreamReadType)
	if err := stream.Start(); err != nil {
		return nil, err
	}
	return NewOpenReadOutWebsocketStream(stream), nil
}
func (c *wsConnectorImpl) AcceptReplicationRemoteReadStream(w http.ResponseWriter, r *http.Request) (serverStream.BStoreOpenReadStreamInCall, error) {
	stream := websocket.NewStreamServer(w, r, c.wsHub, c.openReadInStreamReadType)
	if err := stream.Start(); err != nil {
		return nil, err
	}
	return NewOpenReadInWebsocketStream(stream), nil
}
func NewOpenPublisherOutWebsocketStream(stream websocket.StreamClient) *OpenPublisherOutWebsocketStream {
	return &OpenPublisherOutWebsocketStream{stream: stream}
}
func (s *OpenPublisherOutWebsocketStream) Write(arg *cherami.PutMessage) error {
	return s.stream.Write(arg)
}
func (s *OpenPublisherOutWebsocketStream) Flush() error {
	return s.stream.Flush()
}
func (s *OpenPublisherOutWebsocketStream) Read() (*cherami.InputHostCommand, error) {
	msg, err := s.stream.Read()
	if err != nil {
		return nil, err
	}
	return msg.(*cherami.InputHostCommand), err
}
func (s *OpenPublisherOutWebsocketStream) ResponseHeaders() (map[string]string, error) {
	return map[string]string{}, nil
}
func (s *OpenPublisherOutWebsocketStream) Done() error {
	return s.stream.Done()
}
func NewOpenPublisherInWebsocketStream(stream websocket.StreamServer) *OpenPublisherInWebsocketStream {
	return &OpenPublisherInWebsocketStream{stream: stream}
}
func (s *OpenPublisherInWebsocketStream) Write(arg *cherami.InputHostCommand) error {
	return s.stream.Write(arg)
}
func (s *OpenPublisherInWebsocketStream) Flush() error {
	return s.stream.Flush()
}
func (s *OpenPublisherInWebsocketStream) Read() (*cherami.PutMessage, error) {
	msg, err := s.stream.Read()
	if err != nil {
		return nil, err
	}
	return msg.(*cherami.PutMessage), err
}
func (s *OpenPublisherInWebsocketStream) SetResponseHeaders(headers map[string]string) error {
	return nil
}
func (s *OpenPublisherInWebsocketStream) Done() error {
	return s.stream.Done()
}
func NewOpenConsumerOutWebsocketStream(stream websocket.StreamClient) *OpenConsumerOutWebsocketStream {
	return &OpenConsumerOutWebsocketStream{stream: stream}
}
func (s *OpenConsumerOutWebsocketStream) Write(arg *cherami.ControlFlow) error {
	return s.stream.Write(arg)
}
func (s *OpenConsumerOutWebsocketStream) Flush() error {
	return s.stream.Flush()
}
func (s *OpenConsumerOutWebsocketStream) Read() (*cherami.OutputHostCommand, error) {
	msg, err := s.stream.Read()
	if err != nil {
		return nil, err
	}
	return msg.(*cherami.OutputHostCommand), err
}
func (s *OpenConsumerOutWebsocketStream) ResponseHeaders() (map[string]string, error) {
	return map[string]string{}, nil
}
func (s *OpenConsumerOutWebsocketStream) Done() error {
	return s.stream.Done()
}
func NewOpenConsumerInWebsocketStream(stream websocket.StreamServer) *OpenConsumerInWebsocketStream {
	return &OpenConsumerInWebsocketStream{stream: stream}
}
func (s *OpenConsumerInWebsocketStream) Write(arg *cherami.OutputHostCommand) error {
	return s.stream.Write(arg)
}
func (s *OpenConsumerInWebsocketStream) Flush() error {
	return s.stream.Flush()
}
func (s *OpenConsumerInWebsocketStream) Read() (*cherami.ControlFlow, error) {
	msg, err := s.stream.Read()
	if err != nil {
		return nil, err
	}
	return msg.(*cherami.ControlFlow), err
}
func (s *OpenConsumerInWebsocketStream) SetResponseHeaders(headers map[string]string) error {
	return nil
}
func (s *OpenConsumerInWebsocketStream) Done() error {
	return s.stream.Done()
}
func NewOpenAppendOutWebsocketStream(stream websocket.StreamClient) *OpenAppendOutWebsocketStream {
	return &OpenAppendOutWebsocketStream{stream: stream}
}
func (s *OpenAppendOutWebsocketStream) Write(arg *store.AppendMessage) error {
	return s.stream.Write(arg)
}
func (s *OpenAppendOutWebsocketStream) Flush() error {
	return s.stream.Flush()
}
func (s *OpenAppendOutWebsocketStream) Read() (*store.AppendMessageAck, error) {
	msg, err := s.stream.Read()
	if err != nil {
		return nil, err
	}
	return msg.(*store.AppendMessageAck), err
}
func (s *OpenAppendOutWebsocketStream) ResponseHeaders() (map[string]string, error) {
	return map[string]string{}, nil
}