version

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package version provides version negotiation and compatibility checking for gRPC plugins

Index

Constants

This section is empty.

Variables

View Source
var CurrentProtocolVersion = ProtocolVersion{
	Major: 1,
	Minor: 0,
	Patch: 0,
}

Current protocol version - update when making breaking changes

View Source
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

type ProtocolVersion struct {
	Major int
	Minor int
	Patch int
}

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")

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL