diff --git a/plugin/example_hello_world_test.go b/plugin/example_hello_world_test.go index b4716d5bf1..2918ad7875 100644 --- a/plugin/example_hello_world_test.go +++ b/plugin/example_hello_world_test.go @@ -10,10 +10,13 @@ import ( "github.com/mattermost/mattermost-server/v5/plugin" ) +// HelloWorldPlugin implements the interface expected by the Mattermost server to communicate +// between the server and plugin processes. type HelloWorldPlugin struct { plugin.MattermostPlugin } +// ServeHTTP demonstrates a plugin that handles HTTP requests by greeting the world. func (p *HelloWorldPlugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, "Hello, world!") } diff --git a/plugin/example_help_test.go b/plugin/example_help_test.go index 883d6f0eb5..f03849a942 100644 --- a/plugin/example_help_test.go +++ b/plugin/example_help_test.go @@ -23,6 +23,8 @@ type configuration struct { channelID string } +// HelpPlugin implements the interface expected by the Mattermost server to communicate +// between the server and plugin processes. type HelpPlugin struct { plugin.MattermostPlugin @@ -85,6 +87,7 @@ func (p *HelpPlugin) OnConfigurationChange() error { return nil } +// MessageHasBeenPosted automatically replies to posts that plea for help. func (p *HelpPlugin) MessageHasBeenPosted(c *plugin.Context, post *model.Post) { configuration := p.getConfiguration()