hiboot: hidevops.io/hiboot/pkg/starter/grpc Index | Files | Directories

package grpc

import "hidevops.io/hiboot/pkg/starter/grpc"

Package grpc provides the hiboot starter for injectable grpc client and server dependency


Package Files

autoconfigure.go client.go clientconnector.go health.go properties.go server.go


const (
    // Profile is the profile of grpc, it should be as same as the package name
    Profile = "grpc"


var Client = RegisterClient

Client register client from application, it is a alias to RegisterClient

var Server = RegisterServer

Server alias to RegisterServer

func RegisterClient Uses

func RegisterClient(name string, clientConstructors ...interface{})

RegisterClient register client from application

func RegisterServer Uses

func RegisterServer(register interface{}, server interface{})

RegisterServer register server from application

type ClientConnector Uses

type ClientConnector interface {
    // Connect connect the gRPC client
    Connect(name string, cb interface{}, prop *ClientProperties) (gRPCCli interface{}, err error)

ClientConnector interface is response for creating grpc client connection

type ClientFactory Uses

type ClientFactory interface {

ClientFactory build grpc clients

type ClientProperties Uses

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 Uses

type HealthCheckService struct {
    // contains filtered or unexported fields


func NewHealthCheckService Uses

func NewHealthCheckService(healthClient pb.HealthClient) *HealthCheckService

NewHealthCheckService is the constructor of healthCheckService

func (*HealthCheckService) Name Uses

func (c *HealthCheckService) Name() (name string)

Status return health check display name grpc

func (*HealthCheckService) Status Uses

func (c *HealthCheckService) Status() (up bool)

Status return grpc health check status as bool

type ServerFactory Uses

type ServerFactory interface {

ServerFactory build grpc servers


mockgrpcPackage mockgrpc is a generated GoMock package.

Package grpc imports 15 packages (graph). Updated 2019-09-15. Refresh now. Tools for package owners.