service

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

package service 框架启动的各种服务

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendService

func AppendService(s ServiceBase) error

AppendService 添加一个服务

Types

type GRPCHealthService

type GRPCHealthService struct{}

GRPCHealthService 响应consul健康检查的健康服务。 并且实现了 protobuf 的 HealthServer 接口

func GetGRPCHealthService

func GetGRPCHealthService() *GRPCHealthService

func (GRPCHealthService) Check

func (GRPCHealthService) RegisterServiceHandlerFromEndpoint

func (v GRPCHealthService) RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

func (GRPCHealthService) RegisterServiceServer

func (v GRPCHealthService) RegisterServiceServer(server *grpc.Server)

///////////////////////

func (GRPCHealthService) Watch

type ServiceBase

type ServiceBase interface {
	// RegisterServiceServer 注册一个服务
	RegisterServiceServer(server *grpc.Server)
	// RegisterServiceHandlerFromEndpoint 注册一个gRPC网关服务
	RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
}

ServiceBase 服务需要实现的接口

func GetServices

func GetServices() []ServiceBase

GetServices 获取服务列表

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL