1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-07-12 22:41:07 +02:00

Add grpc plugin (#2758)

* Add grpc plugin

* remove stale readmes
This commit is contained in:
Asim Aslam
2025-05-14 21:04:42 +01:00
committed by GitHub
parent 01b8394c81
commit 230505bf5a
40 changed files with 5527 additions and 0 deletions

40
client/grpc/message.go Normal file
View File

@ -0,0 +1,40 @@
package grpc
import (
"go-micro.dev/v5/client"
)
type grpcEvent struct {
topic string
contentType string
payload interface{}
}
func newGRPCEvent(topic string, payload interface{}, contentType string, opts ...client.MessageOption) client.Message {
var options client.MessageOptions
for _, o := range opts {
o(&options)
}
if len(options.ContentType) > 0 {
contentType = options.ContentType
}
return &grpcEvent{
payload: payload,
topic: topic,
contentType: contentType,
}
}
func (g *grpcEvent) ContentType() string {
return g.contentType
}
func (g *grpcEvent) Topic() string {
return g.topic
}
func (g *grpcEvent) Payload() interface{} {
return g.payload
}