milvus/cmd/distributed/components/proxy_service.go
sunby 675426ea07 Add proxyservice/proxynode/indexservice/indexnode wrapper
Signed-off-by: sunby <bingyi.sun@zilliz.com>
2021-02-01 11:36:59 +08:00

34 lines
629 B
Go

package components
import (
"context"
grpcproxyservice "github.com/zilliztech/milvus-distributed/internal/distributed/proxyservice"
)
type ProxyService struct {
svr *grpcproxyservice.Server
}
func NewProxyService(ctx context.Context) (*ProxyService, error) {
service := &ProxyService{}
svr, err := grpcproxyservice.NewServer(ctx)
if err != nil {
return nil, err
}
service.svr = svr
return service, nil
}
func (s *ProxyService) Run() error {
if err := s.svr.Run(); err != nil {
return err
}
return nil
}
func (s *ProxyService) Stop() error {
if err := s.svr.Stop(); err != nil {
return err
}
return nil
}