mirror of
https://github.com/rocky-linux/peridot.git
synced 2024-11-05 14:31:22 +00:00
19 lines
453 B
Markdown
19 lines
453 B
Markdown
|
# Reflection
|
||
|
|
||
|
Package reflection implements server reflection service.
|
||
|
|
||
|
The service implemented is defined in: https://github.com/grpc/grpc/blob/master/src/proto/grpc/reflection/v1alpha/reflection.proto.
|
||
|
|
||
|
To register server reflection on a gRPC server:
|
||
|
```go
|
||
|
import "google.golang.org/grpc/reflection"
|
||
|
|
||
|
s := grpc.NewServer()
|
||
|
pb.RegisterYourOwnServer(s, &server{})
|
||
|
|
||
|
// Register reflection service on gRPC server.
|
||
|
reflection.Register(s)
|
||
|
|
||
|
s.Serve(lis)
|
||
|
```
|