protocol

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package protocol defines the plugin protocol version and compatibility checking.

Package protocol defines the plugin protocol version and compatibility checking.

Package protocol provides conversion utilities between internal and external plugin types.

Package protocol defines the plugin protocol version and compatibility checking.

Index

Constants

View Source
const (
	// PluginTypeGoPlugin is an alias to the public constant.
	PluginTypeGoPlugin = tinctplugin.PluginTypeGoPlugin

	// PluginTypeJSON is an alias to the public constant.
	PluginTypeJSON = tinctplugin.PluginTypeJSON
)
View Source
const MinCompatibleVersion = plugin.MinCompatibleVersion

MinCompatibleVersion is an alias to the public minimum compatible version.

View Source
const ProtocolVersion = plugin.ProtocolVersion

ProtocolVersion is an alias to the public plugin protocol version.

Variables

Handshake is an alias to the public plugin.Handshake configuration.

Functions

func IsCompatible

func IsCompatible(pluginVersionStr string) (bool, error)

IsCompatible checks if a plugin protocol version is compatible with the current tinct version. Rules: - Major version must match exactly (breaking changes). - Minor version can be higher (backward compatible). - Patch version can be any value (bug fixes only).

Types

type DetectorResult

type DetectorResult struct {
	// Type indicates which protocol the plugin uses.
	Type PluginType

	// SupportsGoPlugin indicates if the plugin binary has go-plugin support.
	SupportsGoPlugin bool

	// PluginInfo contains metadata from --plugin-info.
	PluginInfo PluginInfo
}

DetectorResult contains information about a detected plugin protocol.

func DetectProtocol

func DetectProtocol(pluginPath string) (*DetectorResult, error)

DetectProtocol detects which protocol a plugin uses by querying it.

type FlagHelp

type FlagHelp = plugin.FlagHelp

FlagHelp is a type alias to the public plugin.FlagHelp type. External plugins should import github.com/jmylchreest/tinct/pkg/plugin directly.

type PluginInfo

type PluginInfo = plugin.PluginInfo

PluginInfo is a type alias to the public plugin.PluginInfo type. External plugins should import github.com/jmylchreest/tinct/pkg/plugin directly.

type PluginType

type PluginType = tinctplugin.PluginType

PluginType is an alias to the public plugin.PluginType type.

type Version

type Version struct {
	Major int
	Minor int
	Patch int
}

Version represents a parsed protocol version.

func Parse

func Parse(version string) (Version, error)

Parse parses a version string in "MAJOR.MINOR.PATCH" format.

func (Version) AtLeast added in v0.2.0

func (v Version) AtLeast(other Version) bool

AtLeast returns true if v is greater than or equal to other.

func (Version) String

func (v Version) String() string

String returns the string representation of the version.

Jump to

Keyboard shortcuts

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