consul

package
v0.0.0-...-9a41f76 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discovery

func Discovery(addr string, serviceName string) (string, error)

Discovery 服务发现

Types

type Health

type Health struct{}

Health struct health

func (*Health) Check

Check 实现健康检查接口,这里直接返回健康状态,这里也可以有更复杂的健康检查策略,比如根据服务器负载来返回

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewConsul

func NewConsul(address string, serviceName string, servicePort int) (*Service, error)

func (*Service) Deregister

func (c *Service) Deregister() error

func (*Service) Register

func (c *Service) Register() error

Jump to

Keyboard shortcuts

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