-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose cloudevent proto in non-internal package to support receiving protobuf events over gRPC #761
Comments
Sorry if I'm misunderstanding, but what goes against using the official CE Btw: related #744 |
I am encountering the same issue.
We can use the official CE proto file to generate Edit:
package main
import (
format "github.com/cloudevents/sdk-go/binding/format/protobuf/v2"
"github.com/cloudevents/sdk-go/v2/event"
"google.golang.org/protobuf/proto"
)
func main() {
// own CloudEvent struct generated from official CE proto file
ce := &own.CloudEvent{
Id: "test",
}
b, _ := proto.Marshal(ce)
var e event.Event
format.Protobuf.Unmarshal(b, &e)
fmt.Println(e.Context.GetID())
} |
Those that are using proto, would you expect proto to look like one of the transport choices rather than a bit extra on the http client? Would anyone be interested in a first class proto transport like the kafka and pubsub transports exist? |
For my use case, a first-class proto transport would not help. What I would like is more control over the way the CloudEvent protos are encoded (e.g. to work around #759 by moving content to Can you provide more background on why the protos were put in an |
Great, I will work up a PR to expose them. Would you like to have the protos versioned by spec version? I'm not sure it is necessary, but i will defer to a maintainer's judgement 😄 |
If you are asking if we should make releases based on the cloudevents spec version, I would say no, it would make the release process very tricky and it is already tricky with so many modules. But I could be misunderstanding the question. Is there a verison that is embedded in the proto file? Maybe first pass is just pop that internal package into an exported package so you can get at the generated clients and vendor the proto in other projects? |
Scott, PR #793 should address the concerns on this issue, please take a look when you have a chance. Thanks! For clarity, you did understand my question correctly regarding cloudevents spec version, and I agree with you. 👍🏼 |
The use case is writing a gRPC service that accept cloud events in protobuf format, using the sdk-go to generate and parse events.
E.g.
gRPC proto definition
e.g. proto data
server code:
Client code:
At the moment this is not possible as cloudevent proto is inside an internal package, would be possible to expose it or some other way to achieve the same?
The text was updated successfully, but these errors were encountered: