()
| 26 | } |
| 27 | |
| 28 | func ExampleShardedClient() { |
| 29 | options := net2.ConnectionOptions{ |
| 30 | MaxActiveConnections: 4, |
| 31 | } |
| 32 | manager := memcache.NewStaticShardManager( |
| 33 | []string{"localhost:11211", "localhost:11212"}, |
| 34 | func(key string, numShard int) int { |
| 35 | return int(crc32.ChecksumIEEE([]byte(key))) % 2 |
| 36 | }, |
| 37 | options) |
| 38 | |
| 39 | client := memcache.NewShardedClient(manager, memcache.NewRawBinaryClient) |
| 40 | |
| 41 | clientExample(client) |
| 42 | } |
| 43 | |
| 44 | func clientExample(client memcache.Client) { |
| 45 | version := func() { |
nothing calls this directly
no test coverage detected