fix for latest micro
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
8bcc645147
commit
80842ca667
2
go.mod
2
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
|
||||
)
|
||||
|
4
go.sum
4
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=
|
||||
|
12
message.go
12
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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user