mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 10:54:28 +00:00
28 lines
571 B
Go
28 lines
571 B
Go
package main
|
|
|
|
import (
|
|
"github.com/micro/micro/v3/service"
|
|
"github.com/micro/micro/v3/service/logger"
|
|
admin "github.com/micro/services/pkg/service/proto"
|
|
"github.com/micro/services/search/handler"
|
|
pb "github.com/micro/services/search/proto"
|
|
)
|
|
|
|
func main() {
|
|
// Create service
|
|
srv := service.New(
|
|
service.Name("search"),
|
|
service.Version("latest"),
|
|
)
|
|
|
|
h := handler.New(srv)
|
|
// Register handler
|
|
pb.RegisterSearchHandler(srv.Server(), h)
|
|
admin.RegisterAdminHandler(srv.Server(), h)
|
|
|
|
// Run service
|
|
if err := srv.Run(); err != nil {
|
|
logger.Fatal(err)
|
|
}
|
|
}
|