You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
kratos/contrib/opensergo
包子 7eca8f8034
deps: upgrade kratos version to v2.6.1 (#2716)
2 years ago
..
README.md feat(contrib/opensergo): add opensergo reportMetadata fields (#1996) 3 years ago
go.mod deps: upgrade kratos version to v2.6.1 (#2716) 2 years ago
go.sum build(deps): bump golang.org/x/net in /contrib/opensergo (#2699) 2 years ago
opensergo.go cleanup: use HTTP package methods replace GET POST DELETE... (#2412) 2 years ago
opensergo_test.go cleanup: use HTTP package methods replace GET POST DELETE... (#2412) 2 years ago

README.md

OpenSergo

Usage

	osServer, err := opensergo.New(opensergo.WithEndpoint("localhost:9090"))
	if err != nil {
		panic("init opensergo error")
	}

	s := &server{}
	grpcSrv := grpc.NewServer(
		grpc.Address(":9000"),
		grpc.Middleware(
			recovery.Recovery(),
		),
	)
	helloworld.RegisterGreeterServer(grpcSrv, s)

	app := kratos.New(
		kratos.Name(Name),
		kratos.Server(
			grpcSrv,
		),
	)

	osServer.ReportMetadata(context.Background(), app)

	if err := app.Run(); err != nil {
		log.Fatal(err)
	}