Documentation

Overview

    Package etcdtest provides test support for obtaining a client to an Etcd server.

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    func Cleanup

    func Cleanup()

      Cleanup is called at the completion of each test using TestClient, to remove any remaining key/value fixtures in the Etcd store.

      func TestClient

      func TestClient() *clientv3.Client

        TestClient returns a client of the embedded Etcd test server. It asserts that the Etcd keyspace is empty before returning to the client. In other words, it asserts that the prior test cleaned up after itself.

        func TestMainWithEtcd

        func TestMainWithEtcd(m *testing.M)

          TestMainWithEtcd is to be called by other packages which require functionality of the etcdtest package, before those tests run, as:

          func TestMain(m *testing.M) { etcdtest.TestMainWithEtcd(m) }
          

          This TestMain function is automatically invoked by the `go test` tool, providing an opportunity to start the embedded Etcd server prior to test invocations.

          Types

          This section is empty.

          Source Files