diff --git a/cmd/clients/go_template.go b/cmd/clients/go_template.go index 37458ec..55e36ae 100644 --- a/cmd/clients/go_template.go +++ b/cmd/clients/go_template.go @@ -1,6 +1,6 @@ package main -const goIndexTemplate = `package m3o +const goIndexTemplate = `package services import( {{ range $service := .services }}"github.com/micro/services/clients/go/{{ $service.Name}}" @@ -25,7 +25,7 @@ type Client struct { const goServiceTemplate = `{{ $service := .service }}package {{ $service.Name }} import( - "github.com/m3o/m3o-go/client" + "github.com/micro/micro-go/client" ) func New{{ title $service.Name }}Service(token string) *{{ title $service.Name }}Service { @@ -72,7 +72,7 @@ import( } ` -const curlExampleTemplate = `{{ $service := .service }}curl "https://api.m3o.com/v1/{{ $service.Name }}/{{ title .endpoint }}" \ +const curlExampleTemplate = `{{ $service := .service }}curl "http://localhost:8080/{{ $service.Name }}/{{ title .endpoint }}" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $MICRO_API_TOKEN" \ -d '{{ tsExampleRequest $service.Name .endpoint $service.Spec.Components.Schemas .example.Request }}'` diff --git a/examples/stream/publish/curl/publishAMessage.sh b/examples/stream/publish/curl/publishAMessage.sh deleted file mode 100755 index d4b145e..0000000 --- a/examples/stream/publish/curl/publishAMessage.sh +++ /dev/null @@ -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" -}' \ No newline at end of file diff --git a/examples/stream/publish/go/publishAMessage.go b/examples/stream/publish/go/publishAMessage.go deleted file mode 100755 index eee4024..0000000 --- a/examples/stream/publish/go/publishAMessage.go +++ /dev/null @@ -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) -} diff --git a/examples/stream/publish/node/publishAMessage.js b/examples/stream/publish/node/publishAMessage.js deleted file mode 100755 index 279d4c9..0000000 --- a/examples/stream/publish/node/publishAMessage.js +++ /dev/null @@ -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(); diff --git a/examples/stream/subscribe/curl/subscribeToATopic.sh b/examples/stream/subscribe/curl/subscribeToATopic.sh deleted file mode 100755 index b3878d4..0000000 --- a/examples/stream/subscribe/curl/subscribeToATopic.sh +++ /dev/null @@ -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" -}' \ No newline at end of file diff --git a/examples/stream/subscribe/go/subscribeToATopic.go b/examples/stream/subscribe/go/subscribeToATopic.go deleted file mode 100755 index ce513fa..0000000 --- a/examples/stream/subscribe/go/subscribeToATopic.go +++ /dev/null @@ -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) -} diff --git a/examples/stream/subscribe/node/subscribeToATopic.js b/examples/stream/subscribe/node/subscribeToATopic.js deleted file mode 100755 index 9ddceb6..0000000 --- a/examples/stream/subscribe/node/subscribeToATopic.js +++ /dev/null @@ -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(); diff --git a/notes/handler/notes.go b/notes/handler/notes.go index 99ec246..7c82f17 100644 --- a/notes/handler/notes.go +++ b/notes/handler/notes.go @@ -10,22 +10,22 @@ import ( "github.com/micro/micro/v3/service/client" "github.com/micro/micro/v3/service/errors" "github.com/micro/micro/v3/service/store" + streamPb "github.com/micro/services/mq/proto" pb "github.com/micro/services/notes/proto" "github.com/micro/services/pkg/tenant" - streamPb "github.com/micro/services/stream/proto" "google.golang.org/protobuf/types/known/structpb" ) // New returns an initialized Notes func New(c client.Client) *Notes { return &Notes{ - Stream: streamPb.NewStreamService("stream", c), + Stream: streamPb.NewMqService("mq", c), } } // Notes implements the notes proto definition type Notes struct { - Stream streamPb.StreamService + Stream streamPb.MqService } func newMessage(ev map[string]interface{}) *structpb.Struct {