Refactor Chats Service (#48)

This commit is contained in:
ben-toogood
2021-01-27 11:43:09 +00:00
committed by GitHub
parent 6ab2b2d9fa
commit 54c5994faf
30 changed files with 1855 additions and 82 deletions

25
test/chat/main.go Normal file
View File

@@ -0,0 +1,25 @@
package main
import (
"github.com/micro/micro/v3/service"
"github.com/micro/micro/v3/service/logger"
"github.com/micro/services/chat/handler"
pb "github.com/micro/services/chat/proto"
)
func main() {
// Create the service
srv := service.New(
service.Name("chat"),
service.Version("latest"),
)
// Register the handler against the server
pb.RegisterChatHandler(srv.Server(), new(handler.Chat))
// Run the service
if err := srv.Run(); err != nil {
logger.Fatal(err)
}
}