()
| 395 | } |
| 396 | |
| 397 | func setupDefaultMemcachedClient() (*MemcachedClient, *mockMemcachedClientBackend, error) { |
| 398 | backend := newMockMemcachedClientBackend() |
| 399 | client, err := newMemcachedClient( |
| 400 | log.NewNopLogger(), |
| 401 | backend, |
| 402 | &mockServerSelector{ |
| 403 | servers: []mockServer{ |
| 404 | { |
| 405 | addr: "127.0.0.1:11211", |
| 406 | }, |
| 407 | { |
| 408 | addr: "127.0.0.2:11211", |
| 409 | }, |
| 410 | }, |
| 411 | }, |
| 412 | MemcachedClientConfig{ |
| 413 | Addresses: []string{"localhost"}, |
| 414 | MaxAsyncConcurrency: 1, |
| 415 | MaxAsyncBufferSize: 10, |
| 416 | }, |
| 417 | prometheus.NewPedanticRegistry(), |
| 418 | "test", |
| 419 | ) |
| 420 | |
| 421 | return client, backend, err |
| 422 | } |
| 423 | |
| 424 | type mockMemcachedClientBackend struct { |
| 425 | allocations int |
no test coverage detected