support request content type and call address
This commit is contained in:
31
message.go
Normal file
31
message.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"github.com/micro/go-micro/client"
|
||||
)
|
||||
|
||||
type httpMessage struct {
|
||||
topic string
|
||||
contentType string
|
||||
payload interface{}
|
||||
}
|
||||
|
||||
func newHTTPMessage(topic string, payload interface{}, contentType string) client.Message {
|
||||
return &httpMessage{
|
||||
payload: payload,
|
||||
topic: topic,
|
||||
contentType: contentType,
|
||||
}
|
||||
}
|
||||
|
||||
func (h *httpMessage) ContentType() string {
|
||||
return h.contentType
|
||||
}
|
||||
|
||||
func (h *httpMessage) Topic() string {
|
||||
return h.topic
|
||||
}
|
||||
|
||||
func (h *httpMessage) Payload() interface{} {
|
||||
return h.payload
|
||||
}
|
Reference in New Issue
Block a user