mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-15 20:44:46 +00:00
remove m3o references (#256)
* remove m3o references * fix notes * remove cruft
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
curl "https://api.m3o.com/v1/stream/Publish" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"message": {
|
||||
"id": "1",
|
||||
"type": "signup",
|
||||
"user": "john"
|
||||
},
|
||||
"topic": "events"
|
||||
}'
|
||||
@@ -1,22 +0,0 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/micro/services/clients/go/stream"
|
||||
)
|
||||
|
||||
// Publish a message to the stream. Specify a topic to group messages for a specific topic.
|
||||
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",
|
||||
},
|
||||
Topic: "events",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
const { StreamService } = require("m3o/stream");
|
||||
|
||||
// Publish a message to the stream. Specify a topic to group messages for a specific topic.
|
||||
async function publishAmessage() {
|
||||
let streamService = new StreamService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await streamService.publish({
|
||||
message: {
|
||||
id: "1",
|
||||
type: "signup",
|
||||
user: "john",
|
||||
},
|
||||
topic: "events",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
publishAmessage();
|
||||
@@ -1,6 +0,0 @@
|
||||
curl "https://api.m3o.com/v1/stream/Subscribe" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"topic": "events"
|
||||
}'
|
||||
@@ -1,17 +0,0 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/micro/services/clients/go/stream"
|
||||
)
|
||||
|
||||
// Subscribe to messages for a given topic.
|
||||
func SubscribeToAtopic() {
|
||||
streamService := stream.NewStreamService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := streamService.Subscribe(&stream.SubscribeRequest{
|
||||
Topic: "events",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
const { StreamService } = require("m3o/stream");
|
||||
|
||||
// Subscribe to messages for a given topic.
|
||||
async function subscribeToAtopic() {
|
||||
let streamService = new StreamService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await streamService.subscribe({
|
||||
topic: "events",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
subscribeToAtopic();
|
||||
Reference in New Issue
Block a user