add the chat service (#381)

This commit is contained in:
Asim Aslam
2022-02-17 16:33:10 +00:00
committed by GitHub
parent 718466a4a1
commit c49ee7e8b1
13 changed files with 2846 additions and 23 deletions

24
chat/main.go Normal file
View File

@@ -0,0 +1,24 @@
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)
}
}