(key apiKey, sortedSupportedVersions ...apiVersion)
| 70 | type apiVersionMap map[apiKey]ApiVersion |
| 71 | |
| 72 | func (v apiVersionMap) negotiate(key apiKey, sortedSupportedVersions ...apiVersion) apiVersion { |
| 73 | x := v[key] |
| 74 | |
| 75 | for i := len(sortedSupportedVersions) - 1; i >= 0; i-- { |
| 76 | s := sortedSupportedVersions[i] |
| 77 | |
| 78 | if apiVersion(x.MaxVersion) >= s { |
| 79 | return s |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | return -1 |
| 84 | } |
| 85 | |
| 86 | // ConnConfig is a configuration object used to create new instances of Conn. |
| 87 | type ConnConfig struct { |
no test coverage detected