wconsul

package
v0.0.0-...-849f898 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

Documentation

Index

Constants

View Source
const (
	// LBPolicyRandom lb policy: random
	LBPolicyRandom = "csl_random"
)

Variables

This section is empty.

Functions

func DefaultClient

func DefaultClient() *capi.Client

DefaultClient get default consul client instance

func InitDefaultClient

func InitDefaultClient(consulServerAddr string) *capi.Client

InitDefaultClient init default consul client

func NewClient

func NewClient(consulServerAddr string) (*capi.Client, error)

NewClient new consul client with (URI)Scheme='http'

func NewGrpcSvcCheck

func NewGrpcSvcCheck(host string, port int, interval, timeout string, useTLS bool) *capi.AgentServiceCheck

NewGrpcSvcCheck ...

func NewHTTPSvcCheck

func NewHTTPSvcCheck(name, url string, headers map[string][]string, method, interval, timeout string) *capi.AgentServiceCheck

NewHTTPSvcCheck interval and timeout are in Go time format

reference: https://www.consul.io/docs/agent/checks.html

func OneHealthSvcRandom

func OneHealthSvcRandom(svcName, tag string) (*capi.AgentService, error)

OneHealthSvcRandom ...

func SvcDeregistration

func SvcDeregistration(serviceID string) error

SvcDeregistration ...

func SvcRegistration

func SvcRegistration(svc *SvcInfo) error

SvcRegistration ...

Types

type SvcInfo

type SvcInfo struct {
	ID      string
	Name    string
	Host    string
	Port    int
	Tags    []string
	Checker *capi.AgentServiceCheck
}

SvcInfo ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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