1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-10 01:40:44 +00:00
v2fly/app/commander/service.go

32 lines
633 B
Go
Raw Normal View History

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