negotiated

command
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

README

Negotiated version KV Example

This example builds a simple key/value store CLI where the plugin version can be negotiated between client and server.

# This builds the main CLI
$ go build -o kv

# This builds the plugin written in Go
$ go build -o kv-plugin ./plugin-go

# Write a value using proto version 3 and grpc
$ KV_PROTO=grpc ./kv put hello world

# Read it back using proto version 2 and netrpc
$ KV_PROTO=netrpc ./kv get hello
world

Written from plugin version 3
Read by plugin version 2

Negotiated Protocol

The Client sends the list of available plugin versions to the server. When presented with a list of plugin versions, the server iterates over them in reverse, and uses the highest numbered match to choose the plugins to execute. If a legacy client is used and no versions are sent to the server, the server will default to the oldest version in its configuration.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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