func (streamer *ServerStreamer) Send(message proto.Message) error {
	json, err := streamer.marshaler.Marshal(message)
	if err != nil {
		return fmt.Errorf("error json-encoding message: %s", err.Error())
	}
	return streamer.sendJSONArrayMessage(json)
}
Send sends a `message` over the REST stream using chunked-encoding according to the constructor
chunkSize parameter.
package resttools
import (
	"bytes"
	"context"
	"fmt"
	"io"
	"net/http"
	"google.golang.org/grpc"
	"google.golang.org/protobuf/encoding/protojson"
	"google.golang.org/protobuf/proto"
)
const ServerStreamingChunkSize = 30
type ServerStreamer struct {
	buffer    bytes.Buffer  
	chunkSize int
	output    io.Writer     
	flusher   http.Flusher  
	marshaler *protojson.MarshalOptions
	started   bool
	grpc.ServerStream
}
func NewServerStreamer(responseWriter io.Writer, chunkSize int) (*ServerStreamer, error) {
	if responseWriter == nil {
		return nil, fmt.Errorf("error: responseWriter provided is nil")
	}
	flusher, ok := responseWriter.(http.Flusher)
	if !ok {
		return nil, fmt.Errorf("error: responseWriter provided does not implement http.Flusher")
	}
	if chunkSize < 0 {
		return nil, fmt.Errorf("error: chunkSize must be non-negative")
	}
	streamer := &ServerStreamer{
		chunkSize: chunkSize,
		output:    responseWriter,
		flusher:   flusher,
		marshaler: ToJSON(),
	}
	return streamer, nil
}