xconsul

package
v0.0.0-...-9f39f39 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnInitErr = fmt.Errorf("xconsul未初始化")

Functions

func Initialize

func Initialize() error

func RegisterService

func RegisterService(opts ...func(param *capi.AgentServiceRegistration)) error

func WithDefaultRoute

func WithDefaultRoute(pathPrefix string) func(param *capi.AgentServiceRegistration)

func WithHealthCheck

func WithHealthCheck(healthPath string) func(param *capi.AgentServiceRegistration)

WithHealthCheck 增加consul健康检查回调函数 healthPath: 健康检查路径 默认为 /health

Types

type Xconsul

type Xconsul struct {
	IsInit bool
	*capi.Client
}

func (*Xconsul) Initialize

func (x *Xconsul) Initialize() error

func (*Xconsul) RegisterService

func (x *Xconsul) RegisterService(opts ...func(param *capi.AgentServiceRegistration)) error

Jump to

Keyboard shortcuts

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