common

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ContextKey contextKey = "sessionid"

ContextKey 全局context变量Key值

sessionID表示服务链路上一次完成的请求
一般从API网关产生,保证每次请求唯一,并在服务链路上始终保持传输
可用于服务链路追踪使用

Variables

This section is empty.

Functions

func NetInterfaceCheck

func NetInterfaceCheck() (string, error)

NetInterfaceCheck 本机IPV4地址获取方法

func ServiceRegistry

func ServiceRegistry(conf *config.ConfigFile, sType ServiceTransportType, logger log.Logger) *etcdv3.Registrar

ServiceRegistry 服务注册方法

Types

type ServiceTransportType

type ServiceTransportType int

ServiceTransportType 服务注册的通讯协议自定义类型

const (
	GRPCTransport ServiceTransportType
	HTTPTransport
)

服务注册的通讯协议类型枚举

Jump to

Keyboard shortcuts

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