1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-02-20 23:47:21 -05:00
v2fly/app/commander/service.go

29 lines
591 B
Go
Raw Normal View History

2018-02-08 23:24:35 +01:00
package commander
import (
2020-11-20 01:57:31 +08:00
"context"
2018-02-08 23:24:35 +01:00
"google.golang.org/grpc"
2020-11-20 01:57:31 +08:00
"google.golang.org/grpc/reflection"
2021-02-17 04:31:50 +08:00
"github.com/v2fly/v2ray-core/v4/common"
2018-02-08 23:24:35 +01:00
)
2018-04-04 00:57:44 +02:00
// Service is a Commander service.
2018-02-08 23:24:35 +01:00
type Service interface {
2018-04-04 00:57:44 +02:00
// Register registers the service itself to a gRPC server.
2018-02-08 23:24:35 +01:00
Register(*grpc.Server)
}
2020-11-20 01:57:31 +08:00
type reflectionService struct{}
func (r reflectionService) Register(s *grpc.Server) {
reflection.Register(s)
}
func init() {
common.Must(common.RegisterConfig((*ReflectionConfig)(nil), func(ctx context.Context, cfg interface{}) (interface{}, error) {
return reflectionService{}, nil
}))
}