mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 03:05:14 +00:00
Commit from GitHub Actions (Publish APIs & Clients)
This commit is contained in:
@@ -2,8 +2,9 @@ package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/stream"
|
||||
"os"
|
||||
|
||||
"github.com/micro/services/clients/go/stream"
|
||||
)
|
||||
|
||||
// Publish a message to the stream. Specify a topic to group messages for a specific topic.
|
||||
@@ -11,9 +12,9 @@ func PublishAmessage() {
|
||||
streamService := stream.NewStreamService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := streamService.Publish(&stream.PublishRequest{
|
||||
Message: map[string]interface{}{
|
||||
"id": "1",
|
||||
"type": "signup",
|
||||
"user": "john",
|
||||
"id": "1",
|
||||
},
|
||||
Topic: "events",
|
||||
})
|
||||
|
||||
@@ -2,8 +2,9 @@ package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/stream"
|
||||
"os"
|
||||
|
||||
"github.com/micro/services/clients/go/stream"
|
||||
)
|
||||
|
||||
// Subscribe to messages for a given topic.
|
||||
|
||||
Reference in New Issue
Block a user