31 lines
882 B
Go
31 lines
882 B
Go
package main
|
|
|
|
import (
|
|
"net/http"
|
|
"sync"
|
|
|
|
"github.com/mattermost/mattermost/server/public/plugin"
|
|
)
|
|
|
|
// Plugin implements the Mattermost plugin interface.
|
|
type Plugin struct {
|
|
plugin.MattermostPlugin
|
|
|
|
configuration *configuration
|
|
configLock sync.RWMutex
|
|
botUserID string
|
|
ollamaClient *OllamaClient
|
|
conversationStore *ConversationStore
|
|
rateLimiter *RateLimiter
|
|
}
|
|
|
|
// ServeHTTP allows the plugin to handle HTTP requests.
|
|
// Not used in v0.1.0 — reserved for future metrics endpoint.
|
|
func (p *Plugin) ServeHTTP(_ *plugin.Context, w http.ResponseWriter, r *http.Request) {
|
|
http.NotFound(w, r)
|
|
}
|
|
|
|
// Note: Plugin does not compile-check against plugin.Hooks because that
|
|
// interface has ~60 methods. Instead, Implemented() tells the server which
|
|
// hooks this plugin handles, and plugin.ClientMain handles the rest.
|