serviceDiscovery

package
v0.0.0-...-21c380a Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsulResolverInit

func ConsulResolverInit(address string, serviceName string) error

func CreateConsulRegisterClient

func CreateConsulRegisterClient(csAddr string) error

create a consul client for register and unregister service to consul csAddr is the address of consul server this function should only call once

func DeregisterServiceFromConsul

func DeregisterServiceFromConsul(info ServiceInfo) error

API for user to deregister a service to consul server

func RegisterServiceToConsul

func RegisterServiceToConsul(info ServiceInfo) error

API for user to register a service to consul server

func SignalDone

func SignalDone()

User need call SignalDone() wait clientMonitor finish work

func SignalNotify

func SignalNotify()

User need call SignalNotify when received signal to let clientMonitor goroutine deregister services

Types

type ServiceInfo

type ServiceInfo struct {
	Addr           string
	Port           int
	ServiceName    string
	UpdateInterval time.Duration
	CheckInterval  int
}

Jump to

Keyboard shortcuts

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