Scaffold Go plugin skeleton with Ollama client, conversation store, rate limiter
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
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.
|
||||
Reference in New Issue
Block a user