github.com/trigonella/mattermost-server@v5.11.1+incompatible/plugin/example_hello_world_test.go (about) 1 package plugin_test 2 3 import ( 4 "fmt" 5 "net/http" 6 7 "github.com/mattermost/mattermost-server/plugin" 8 ) 9 10 type HelloWorldPlugin struct { 11 plugin.MattermostPlugin 12 } 13 14 func (p *HelloWorldPlugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request) { 15 fmt.Fprint(w, "Hello, world!") 16 } 17 18 // This example demonstrates a plugin that handles HTTP requests which respond by greeting the 19 // world. 20 func Example_helloWorld() { 21 plugin.ClientMain(&HelloWorldPlugin{}) 22 }