Documentation ¶
Overview ¶
Package grpc provides the hiboot starter for injectable grpc client and server dependency
Index ¶
- Constants
- Variables
- func Connect(address string, tracer jaeger.Tracer) (conn *grpc.ClientConn, err error)
- func RegisterClient(name string, clientConstructors ...interface{})
- func RegisterServer(register interface{}, server interface{})
- type ClientConn
- type ClientConnector
- type ClientFactory
- type ClientProperties
- type HealthCheckService
- type ServerFactory
Constants ¶
View Source
const (
// Profile is the profile of grpc, it should be as same as the package name
Profile = "grpc"
)
Variables ¶
View Source
var ( Header = grpc.Header Server = RegisterServer )
View Source
var Client = RegisterClient
Client register client from application, it is a alias to RegisterClient
Functions ¶
func RegisterClient ¶ added in v0.4.0
func RegisterClient(name string, clientConstructors ...interface{})
RegisterClient register client from application
func RegisterServer ¶ added in v0.4.0
func RegisterServer(register interface{}, server interface{})
RegisterServer register server from application
Types ¶
type ClientConn ¶ added in v1.5.0
type ClientConn grpc.ClientConn
type ClientConnector ¶ added in v0.6.2
type ClientConnector interface { // Connect connect the gRPC client ConnectWithName(name string, cb interface{}, prop *ClientProperties) (gRPCCli interface{}, err error) Connect(address string) (conn *grpc.ClientConn, err error) }
ClientConnector interface is response for creating grpc client connection
type ClientFactory ¶ added in v0.9.0
type ClientFactory interface { }
ClientFactory build grpc clients
type ClientProperties ¶ added in v0.6.2
type ClientProperties struct { Host string `json:"host"` Port string `json:"port" default:"7575"` PlainText bool `json:"plain_text" default:"true"` KeepAlive keepAlive `json:"keep_alive"` }
ClientProperties used for grpc client injection
type HealthCheckService ¶ added in v0.10.4
type HealthCheckService struct { at.HealthCheckService // contains filtered or unexported fields }
controller
func NewHealthCheckService ¶ added in v0.10.4
func NewHealthCheckService(healthClient pb.HealthClient) *HealthCheckService
NewHealthCheckService is the constructor of healthCheckService
func (*HealthCheckService) Name ¶ added in v0.10.4
func (c *HealthCheckService) Name() (name string)
Status return health check display name grpc
func (*HealthCheckService) Status ¶ added in v0.10.4
func (c *HealthCheckService) Status() (up bool)
Status return grpc health check status as bool
type ServerFactory ¶ added in v0.9.0
type ServerFactory interface { }
ServerFactory build grpc servers
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mockgrpc is a generated GoMock package.
|
Package mockgrpc is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.