consul

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FactoryFor

factor: url -> endpoint instance: ip:port path: /search

func NewConsulClient

func NewConsulClient(consulIP string, consulPort int) consulsd.Client

func NewEp

func NewEp(consulClient consulsd.Client, logger log.Logger, svcName string, dec kithttp.DecodeResponseFunc, path string) endpoint.Endpoint

func NewLogger

func NewLogger() (logger log.Logger)

Types

type Cataloger

type Cataloger interface {
	// Service
	Services() []*Service
}

type Registrar

type Registrar interface {
	Register(svc *Service)
	Deregister(svc *Service)
}

func NewRegistrar

func NewRegistrar(consulClient consulsd.Client, logger log.Logger) Registrar

type Service

type Service struct {
	Name  string
	ID    string // default is svcName_UUID
	IP    string // svc ip, default hostAdmIp
	Port  int    // svc port
	Tags  []string
	Check struct {
		Path     string // default /health
		Interval string // "60s"
		Timeout  string // "10s"
	}
}

func NewService added in v0.4.0

func NewService(svc *Service) *Service

Jump to

Keyboard shortcuts

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