consul

package
v1.25.3 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsulClient

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

ConsulClient 是实现 RegistryClient 接口的结构体

func (*ConsulClient) DeRegister

func (c *ConsulClient) DeRegister()

DeRegister 方法用于从 Consul 注销服务

func (*ConsulClient) GetServiceURL

func (c *ConsulClient) GetServiceURL(servicename string, groupName ...string) (string, string)

GetServiceURL 方法用于从 Consul 查询服务地址 servicename 是要查询的服务名称 groupName 是可选的服务组名称

func (*ConsulClient) Register

func (c *ConsulClient) Register(etcdConfigData []byte)

Register 方法用于向 Consul 注册服务 etcdConfigData 是包含 Consul 配置的字节切片

Jump to

Keyboard shortcuts

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