summaryrefslogtreecommitdiffstats
path: root/plugin/api.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-06-25 12:33:13 -0700
committerGitHub <noreply@github.com>2018-06-25 12:33:13 -0700
commit1e5c432e1029601a664454388ae366ef69618d62 (patch)
treecb9e8bfb66640ac3b29c934bb2c3202d25aeb368 /plugin/api.go
parentecefa6cdd1e7376046bbec82c1b47f7756fea646 (diff)
downloadchat-1e5c432e1029601a664454388ae366ef69618d62.tar.gz
chat-1e5c432e1029601a664454388ae366ef69618d62.tar.bz2
chat-1e5c432e1029601a664454388ae366ef69618d62.zip
MM-10702 Moving plugins to use hashicorp go-plugin. (#8978)
* Moving plugins to use hashicorp go-plugin. * Tweaks from feedback.
Diffstat (limited to 'plugin/api.go')
-rw-r--r--plugin/api.go18
1 files changed, 10 insertions, 8 deletions
diff --git a/plugin/api.go b/plugin/api.go
index d62c2f069..ed2bfa733 100644
--- a/plugin/api.go
+++ b/plugin/api.go
@@ -4,6 +4,7 @@
package plugin
import (
+ "github.com/hashicorp/go-plugin"
"github.com/mattermost/mattermost-server/model"
)
@@ -104,17 +105,18 @@ type API interface {
// UpdatePost updates a post.
UpdatePost(post *model.Post) (*model.Post, *model.AppError)
- // KeyValueStore returns an object for accessing the persistent key value storage.
- KeyValueStore() KeyValueStore
-}
-
-type KeyValueStore interface {
// Set will store a key-value pair, unique per plugin.
- Set(key string, value []byte) *model.AppError
+ KVSet(key string, value []byte) *model.AppError
// Get will retrieve a value based on the key. Returns nil for non-existent keys.
- Get(key string) ([]byte, *model.AppError)
+ KVGet(key string) ([]byte, *model.AppError)
// Delete will remove a key-value pair. Returns nil for non-existent keys.
- Delete(key string) *model.AppError
+ KVDelete(key string) *model.AppError
+}
+
+var Handshake = plugin.HandshakeConfig{
+ ProtocolVersion: 1,
+ MagicCookieKey: "MATTERMOST_PLUGIN",
+ MagicCookieValue: "Securely message teams, anywhere.",
}