service

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const RequestIDKey = "X-Request-Id"

RequestIDKey requestID的键

Variables

This section is empty.

Functions

func GetRequestID

func GetRequestID(ctx context.Context) string

GetRequestID 获取RequestID

func NewGrpcClientConn

func NewGrpcClientConn(serviceName string, config *viper.Viper) (*grpc.ClientConn, error)

NewGrpcClientConn 获取GrpcConn,根据配置

func WithRequestIDContext

func WithRequestIDContext(ctx context.Context, requestID string) context.Context

WithRequestIDContext 加入requestID的context

Types

type BaseService

type BaseService struct {
	boot.BaseInstance

	Listener   net.Listener // 网络监听
	GrpcServer *grpc.Server // GRPC服务端
	// contains filtered or unexported fields
}

BaseService service的基础服务

func (*BaseService) Init

func (s *BaseService) Init() error

func (*BaseService) Start

func (s *BaseService) Start() error

func (*BaseService) Stop

func (s *BaseService) Stop()

Jump to

Keyboard shortcuts

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