consul

package module
v0.0.0-...-32a9b58 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 6 Imported by: 4

README

consul

Essential Consul API

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupService

func LookupService(consulAddr string, service string) (string, error)

LookupService connects to consul on the given address and looks up for IP address of the service

func NewgRPCHealthCheck

func NewgRPCHealthCheck(service string, address string, port int) *consul.AgentServiceCheck

NewgRPCHealthCheck creates very basic gRPC healthcheck for Consul

func RegistergRPCService

func RegistergRPCService(consulAddr string, myServiceID string, myServiceExternalAddr string) error

RegistergRPCService fire and forget style registering of service in Consul

Types

type Client

type Client interface {
	Lookup(service string, tag string) (ipPort string, err error)
	Register(service string, address string, port int, healthcheck *consul.AgentServiceCheck) error
}

Client essential consul API

func NewConsulClient

func NewConsulClient(addr string) (Client, error)

NewConsulClient returns a Client interface for given consul address

Jump to

Keyboard shortcuts

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