consulcli

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 2 Imported by: 0

README

consulcli

连接etcd服务客户端。

使用示例

	endpoints := []string{"192.168.3.37:2379"}
    cli, err := consulcli.Init(endpoints,
        WithConnectTimeout(time.Second*2),
        // WithAuth("", ""),
        // WithAutoSyncInterval(0),
        // WithLog(zap.NewNop()),
	)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(addr string, opts ...Option) (*api.Client, error)

Init 连接consul服务

Types

type Option

type Option func(*options)

Option set the consul client options.

func WithDatacenter

func WithDatacenter(datacenter string) Option

WithDatacenter set datacenter

func WithScheme

func WithScheme(scheme string) Option

WithScheme set scheme

func WithWaitTime

func WithWaitTime(waitTime time.Duration) Option

WithWaitTime set wait time

Jump to

Keyboard shortcuts

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