use metadata.Metadata (#8)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-11-18 16:50:41 +03:00
committed by GitHub
parent e0ef8b2953
commit daffa9e548
28 changed files with 119 additions and 84 deletions

View File

@@ -6,6 +6,7 @@ import (
"time"
"github.com/unistack-org/micro/v3/codec"
"github.com/unistack-org/micro/v3/metadata"
)
var (
@@ -57,7 +58,7 @@ type Response interface {
// Read the response
Codec() codec.Reader
// read the header
Header() map[string]string
Header() metadata.Metadata
// Read the undecoded response
Read() ([]byte, error)
}

View File

@@ -66,14 +66,14 @@ func (n *noopRequest) Stream() bool {
type noopResponse struct {
codec codec.Reader
header map[string]string
header metadata.Metadata
}
func (n *noopResponse) Codec() codec.Reader {
return n.codec
}
func (n *noopResponse) Header() map[string]string {
func (n *noopResponse) Header() metadata.Metadata {
return n.header
}