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

Index

Package Files

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

Constants

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

Variables

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 {
    at.HealthCheckService
    // contains filtered or unexported fields
}

controller

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

Directories

PathSynopsis
mockgrpcPackage mockgrpc is a generated GoMock package.

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