1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 18:17:52 -05:00
v2fly/app/commander/service.go

29 lines
591 B
Go
Raw Normal View History

2018-02-08 17:24:35 -05:00
package commander
import (
2020-11-19 12:57:31 -05:00
"context"
2018-02-08 17:24:35 -05:00
"google.golang.org/grpc"
2020-11-19 12:57:31 -05:00
"google.golang.org/grpc/reflection"
2021-02-16 15:31:50 -05:00
"github.com/v2fly/v2ray-core/v5/common"
2018-02-08 17:24:35 -05:00
)
2018-04-03 18:57:44 -04:00
// Service is a Commander service.
2018-02-08 17:24:35 -05:00
type Service interface {
2018-04-03 18:57:44 -04:00
// Register registers the service itself to a gRPC server.
2018-02-08 17:24:35 -05:00
Register(*grpc.Server)
}
2020-11-19 12:57:31 -05: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
}))
}