MCPcopy
hub / github.com/segmentio/kafka-go / negotiate

Method negotiate

conn.go:72–84  ·  view source on GitHub ↗
(key apiKey, sortedSupportedVersions ...apiVersion)

Source from the content-addressed store, hash-verified

70type apiVersionMap map[apiKey]ApiVersion
71
72func (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.
87type ConnConfig struct {

Callers 1

negotiateVersionMethod · 0.80

Calls 1

apiVersionTypeAlias · 0.85

Tested by

no test coverage detected