MCPcopy
hub / github.com/etcd-io/etcd / ExampleConfig_insecure

Function ExampleConfig_insecure

client/v3/example_test.go:27–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25func mockConfig_insecure() {}
26
27func ExampleConfig_insecure() {
28 forUnitTestsRunInMockedContext(mockConfig_insecure, func() {
29 cli, err := clientv3.New(clientv3.Config{
30 Endpoints: exampleEndpoints(),
31 DialTimeout: dialTimeout,
32 })
33 if err != nil {
34 log.Fatal(err)
35 }
36 defer cli.Close() // make sure to close the client
37
38 _, err = cli.Put(context.TODO(), "foo", "bar")
39 if err != nil {
40 log.Fatal(err)
41 }
42 })
43
44 // Without the line below the test is not being executed
45
46 // Output:
47}
48
49func mockConfig_withTLS() {}
50

Callers

nothing calls this directly

Calls 5

exampleEndpointsFunction · 0.70
FatalMethod · 0.65
CloseMethod · 0.65
PutMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…