Skip to content

Backend ETCD

The ETCD backend is used to store the configuration. zr read database every time (Default interval is 60 seconds) and apply the configuration.

A complet example is available in the examples/etcd.

Basic usage

1
2
3
4
5
6
7
8
    zr.Setup(
        zr.WithCustomHotReload(
            hr.WithBackendETCD(backend.ConfigBackendETCD{
                Endpoints: []string{"http://localhost:2379"},
                Path:      "/zr/basic/config",
            }),
        ),
    )

Options for the backend

backend.ConfigBackendETCD{
    Endpoints: []string{"http://localhost:2379"},
    Path:      "/zr/basic/config",
    DialTimeout: time.Second * 5,
    TLS:         tlsConfig,
}