summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/mattermost-server/v5/model/plugin_event_data.go
blob: c704c9933940381a419163cbaabd0904a39d3f56 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package model

import (
	"encoding/json"
	"io"
)

// PluginEventData used to notify peers about plugin changes.
type PluginEventData struct {
	Id string `json:"id"`
}

func (p *PluginEventData) ToJson() string {
	b, _ := json.Marshal(p)
	return string(b)
}

func PluginEventDataFromJson(data io.Reader) PluginEventData {
	var m PluginEventData
	json.NewDecoder(data).Decode(&m)
	return m
}