From 80842ca6673b771043549585c78bec4ea8c72b27 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Thu, 16 Dec 2021 15:27:02 +0300 Subject: [PATCH] fix for latest micro Signed-off-by: Vasiliy Tolstov --- go.mod | 2 +- go.sum | 4 ++-- message.go | 12 ++++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 91ae8fc..c474f83 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module go.unistack.org/micro-client-drpc/v3 go 1.16 require ( - go.unistack.org/micro/v3 v3.8.11 + go.unistack.org/micro/v3 v3.8.12 storj.io/drpc v0.0.26 ) diff --git a/go.sum b/go.sum index e4ffe74..8b123c2 100644 --- a/go.sum +++ b/go.sum @@ -12,8 +12,8 @@ github.com/zeebo/errs v1.2.2 h1:5NFypMTuSdoySVTqlNs1dEoU21QVamMQJxW/Fii5O7g= github.com/zeebo/errs v1.2.2/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= go.unistack.org/micro-proto/v3 v3.1.0 h1:q39FwjFiRZn+Ux/tt+d3bJTmDtsQQWa+3SLYVo1vLfA= go.unistack.org/micro-proto/v3 v3.1.0/go.mod h1:DpRhYCBXlmSJ/AAXTmntvlh7kQkYU6eFvlmYAx4BQS8= -go.unistack.org/micro/v3 v3.8.11 h1:Wv1YopcYNcsN3bW8Mv8v6AF99s0uKBtWQ1M/Ag8QLec= -go.unistack.org/micro/v3 v3.8.11/go.mod h1:KMMmOmbgo/D52/rCAbqeKbBsgEEbSKM69he54J3ZIuA= +go.unistack.org/micro/v3 v3.8.12 h1:ACaHE8ZIHFXqEGPSRvXzND4hcqCSQf04WkzOFY6Y1gQ= +go.unistack.org/micro/v3 v3.8.12/go.mod h1:KMMmOmbgo/D52/rCAbqeKbBsgEEbSKM69he54J3ZIuA= golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/message.go b/message.go index ef231fd..822bcca 100644 --- a/message.go +++ b/message.go @@ -2,19 +2,18 @@ package drpc import ( "go.unistack.org/micro/v3/client" + "go.unistack.org/micro/v3/metadata" ) type drpcEvent struct { payload interface{} topic string contentType string + opts client.MessageOptions } func newDRPCEvent(topic string, payload interface{}, contentType string, opts ...client.MessageOption) client.Message { - var options client.MessageOptions - for _, o := range opts { - o(&options) - } + options := client.NewMessageOptions(opts...) if len(options.ContentType) > 0 { contentType = options.ContentType @@ -23,6 +22,7 @@ func newDRPCEvent(topic string, payload interface{}, contentType string, opts .. return &drpcEvent{ payload: payload, topic: topic, + opts: options, contentType: contentType, } } @@ -38,3 +38,7 @@ func (d *drpcEvent) Topic() string { func (d *drpcEvent) Payload() interface{} { return d.payload } + +func (d *drpcEvent) Metadata() metadata.Metadata { + return d.opts.Metadata +}