check in this cruft

This commit is contained in:
Asim Aslam
2019-06-08 19:40:44 +01:00
committed by Vasiliy Tolstov
parent 96d68eeace
commit 502ac83bfe
4 changed files with 65 additions and 6 deletions

37
response.go Normal file
View File

@@ -0,0 +1,37 @@
package grpc
import (
"strings"
"github.com/micro/go-micro/codec"
"google.golang.org/grpc"
)
type response struct {
conn *grpc.ClientConn
stream grpc.ClientStream
codec grpc.Codec
}
// Read the response
func (r *response) Codec() codec.Reader {
return nil
}
// read the header
func (r *response) Header() map[string]string {
md, err := r.stream.Header()
if err != nil {
return map[string]string{}
}
hdr := make(map[string]string)
for k, v := range md {
hdr[k] = strings.Join(v, ",")
}
return hdr
}
// Read the undecoded response
func (r *response) Read() ([]byte, error) {
return nil, nil
}