refactor(rcp): move health interface to core package
This commit is contained in:
parent
4be2c8036d
commit
e13a05bc08
|
@ -1,8 +1,6 @@
|
||||||
package rpc
|
package core
|
||||||
|
|
||||||
import (
|
import "context"
|
||||||
"context"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Health defines a health-check connection.
|
// Health defines a health-check connection.
|
||||||
type Health interface {
|
type Health interface {
|
|
@ -3,6 +3,7 @@ package rpc
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"github.com/appleboy/gorush/core"
|
||||||
"github.com/appleboy/gorush/rpc/proto"
|
"github.com/appleboy/gorush/rpc/proto"
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
|
@ -19,7 +20,7 @@ type healthClient struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewGrpcHealthClient returns a new grpc Client.
|
// NewGrpcHealthClient returns a new grpc Client.
|
||||||
func NewGrpcHealthClient(conn *grpc.ClientConn) Health {
|
func NewGrpcHealthClient(conn *grpc.ClientConn) core.Health {
|
||||||
client := new(healthClient)
|
client := new(healthClient)
|
||||||
client.client = proto.NewHealthClient(conn)
|
client.client = proto.NewHealthClient(conn)
|
||||||
client.conn = conn
|
client.conn = conn
|
||||||
|
|
Loading…
Reference in New Issue