consul

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deregister

func Deregister()

Deregister 反注册

func Init

func Init(address string)

Init 初始化服务注册

func Register

func Register(config *RegisterConfig)

Register 注册到consul

func RegisterGRPC added in v0.1.3

func RegisterGRPC(config *RegisterConfig)

RegisterGRPC GRPC方式注册到consul

Types

type RegisterConfig

type RegisterConfig struct {
	ServiceName                    string        // 服务显示名称
	ServiceAddress                 string        // consul IP地址
	ServicePort                    int           // 端口
	Tags                           []string      // 标签
	Interval                       time.Duration // 健康检查时间间隔(单位秒)
	DeregisterCriticalServiceAfter time.Duration
}

RegisterConfig consul注册配置

Jump to

Keyboard shortcuts

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