consul

package
v1.22.10 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Zlib Imports: 15 Imported by: 0

Documentation

Overview

*

  • by huqiuyun
  • 启动一个服务时,注册到consul中心,从而可以收到配置信息的变化通知

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientWithPoints added in v1.1.9

func NewClientWithPoints(eps config.EndPoints) (*consul.Client, error)

func NewConsulClient

func NewConsulClient(conf config.Config, endPoints config.EndPoints, resol resolver.Resolver) (service.Client, error)

func NewService

func NewService(cfg config.Config, points config.EndPoints, registry registry.Registry) (service.Service, error)

Types

type Base

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

func (*Base) AttachWatcher added in v0.4.6

func (base *Base) AttachWatcher(watcher *Watcher)

func (*Base) Get

func (base *Base) Get(key service.Key) ([]*service.Data, error)

Get interface

func (*Base) Set

func (base *Base) Set(data service.Data) error

Set interface

type Watcher added in v0.4.6

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

func NewWatcher added in v0.4.6

func NewWatcher(client *consul2.Client, sizeChan int) (*Watcher, error)

func (*Watcher) Changed added in v0.4.6

func (watcher *Watcher) Changed(cmd discoveryWatch.Changed)

func (*Watcher) Stop added in v0.4.6

func (watcher *Watcher) Stop() error

func (*Watcher) Watch added in v0.4.6

func (watcher *Watcher) Watch(key discoveryWatch.Key) (discoveryWatch.Chan, error)

Jump to

Keyboard shortcuts

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