Congratualtions you found the Go Metio Library which can be used to interact with Metio Compliant Systems.
go get github.com/bagaluten/metio-go
- OpenTelemetry Tracing
- Metio Streams
- Metio Client
func main() {
ctx := context.Background()
client, err := client.NewClient(client.Config{Host: "localhost:4222", Prefix: nil})
if err != nil {
// do something
}
defer client.Close()
stream := streams.NewStream("stream", client)
events := []types.Event{
{
EventID: "123",
ContextID: nil,
EventType: types.MustParseEventType("group/name/version"),
Payload: types.Payload{
"key": "value",
},
Timestamp: types.TimeNow(),
},
{
EventID: "124",
ContextID: nil,
EventType: types.MustParseEventType("group/name/version"),
Payload: types.Payload{
"key": "value",
},
Timestamp: types.TimeNow(),
},
}
err = stream.Publish(ctx, events)
}