OSDN Git Service

Merge pull request #201 from Bytom/v0.1
[bytom/vapor.git] / vendor / github.com / hashicorp / go-plugin / examples / grpc / plugin-go-netrpc / main.go
diff --git a/vendor/github.com/hashicorp/go-plugin/examples/grpc/plugin-go-netrpc/main.go b/vendor/github.com/hashicorp/go-plugin/examples/grpc/plugin-go-netrpc/main.go
deleted file mode 100644 (file)
index b3bb843..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-package main
-
-import (
-       "fmt"
-       "io/ioutil"
-
-       "github.com/hashicorp/go-plugin"
-       "github.com/hashicorp/go-plugin/examples/grpc/shared"
-)
-
-// Here is a real implementation of KV that writes to a local file with
-// the key name and the contents are the value of the key.
-type KV struct{}
-
-func (KV) Put(key string, value []byte) error {
-       value = []byte(fmt.Sprintf("%s\n\nWritten from plugin-go-netrpc", string(value)))
-       return ioutil.WriteFile("kv_"+key, value, 0644)
-}
-
-func (KV) Get(key string) ([]byte, error) {
-       return ioutil.ReadFile("kv_" + key)
-}
-
-func main() {
-       plugin.Serve(&plugin.ServeConfig{
-               HandshakeConfig: shared.Handshake,
-               Plugins: map[string]plugin.Plugin{
-                       "kv": &shared.KVPlugin{Impl: &KV{}},
-               },
-       })
-}