consul

package
v0.0.0-...-7d43bac Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package consul provides support for service discovery mechanism based on Consul by HashiCorp.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceDiscovery

type ServiceDiscovery struct {
	Client *api.Client // consul client
}

ServiceDiscovery represents service discovery mechanism based on Consul by Hashicorp.

func NewServiceDiscovery

func NewServiceDiscovery(address string) *ServiceDiscovery

NewServiceDiscovery creates service registration and localization based on Consul by Hashicorp. Panics if cannot create an instance.

func (ServiceDiscovery) DeregisterService

func (c ServiceDiscovery) DeregisterService(options ...discovery.Option) error

DeregisterService unregisters service in service discovery catalog.

func (*ServiceDiscovery) Dispose

func (c *ServiceDiscovery) Dispose()

Dispose closes consul client and cleans up ServiceDiscovery instance.

func (ServiceDiscovery) GetServiceAddress

func (c ServiceDiscovery) GetServiceAddress(options ...discovery.Option) (*url.URL, error)

GetServiceAddress gets service address from service discovery catalog.

func (ServiceDiscovery) RegisterService

func (c ServiceDiscovery) RegisterService(options ...discovery.Option) error

RegisterService registers service in service discovery catalog.

Jump to

Keyboard shortcuts

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