package
1.12.6
Repository: https://github.com/go-dev-frame/sponge.git
Documentation: pkg.go.dev

# README

consulcli

Connect to the consul service client.

Example of use

    import "github.com/go-dev-frame/sponge/pkg/consulcli"

    addr := "192.168.3.37:8500"

    // Way 1: setting parameters
    cli, err := consulcli.Init(addr,
        consulcli.WithWaitTime(time.Second*5),
        // consulcli.WithDatacenter(""),
    )

    // Way 2: setting up api.Config
    cli, err = Init("", consulcli.WithConfig(&api.Config{
        Address:    addr,
        Scheme:     "http",
        WaitTime:   time.Second * 5,
        Datacenter: "",
    }))

# Functions

Init connecting to the consul service Note: If the WithConfig(*api.Config) parameter is set, the addr parameter is ignored!.
WithConfig set consul config.
WithDatacenter set datacenter.
WithScheme set scheme.
WithToken set token.
WithWaitTime set wait time.

# Type aliases

Option set the consul client options.