Documentation
¶
Overview ¶
Package version provides version negotiation and compatibility checking for gRPC plugins
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CurrentProtocolVersion = ProtocolVersion{
Major: 1,
Minor: 0,
Patch: 0,
}
Current protocol version - update when making breaking changes
var MinimumSupportedVersion = ProtocolVersion{
Major: 1,
Minor: 0,
Patch: 0,
}
MinimumSupportedVersion defines the oldest supported protocol version
Functions ¶
This section is empty.
Types ¶
type CompatibilityResult ¶
type CompatibilityResult struct {
Compatible bool
ServerVersion ProtocolVersion
PluginVersion ProtocolVersion
Reason string
Recommendation string
}
CompatibilityResult represents the result of a compatibility check
func CheckCompatibility ¶
func CheckCompatibility(serverVersion, pluginVersion ProtocolVersion) CompatibilityResult
CheckCompatibility performs a comprehensive compatibility check
type ProtocolVersion ¶
ProtocolVersion represents the gRPC plugin protocol version
func GetSupportedVersions ¶
func GetSupportedVersions() []ProtocolVersion
GetSupportedVersions returns the list of protocol versions supported by this implementation
func NegotiateVersion ¶
func NegotiateVersion(serverVersions []ProtocolVersion, pluginVersions []ProtocolVersion) (ProtocolVersion, error)
NegotiateVersion negotiates the best compatible version between server and plugin
func ParseVersion ¶
func ParseVersion(versionStr string) (ProtocolVersion, error)
ParseVersion parses a version string into a ProtocolVersion
func (ProtocolVersion) Compare ¶
func (v ProtocolVersion) Compare(other ProtocolVersion) int
Compare returns: -1 if v < other
0 if v == other 1 if v > other
func (ProtocolVersion) IsCompatible ¶
func (v ProtocolVersion) IsCompatible(other ProtocolVersion) bool
IsCompatible checks if the given version is compatible with the current protocol
func (ProtocolVersion) IsSupported ¶
func (v ProtocolVersion) IsSupported() bool
IsSupported checks if the version is still supported
func (ProtocolVersion) String ¶
func (v ProtocolVersion) String() string
String returns the version as a string (e.g., "1.0.0")