mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-29 00:47:08 +02:00
move server to server directory.
This commit is contained in:
parent
da45f62ca8
commit
cfb423b13d
211 changed files with 18 additions and 10 deletions
35
server/internal/plugins/filetransfer/plugin.go
Normal file
35
server/internal/plugins/filetransfer/plugin.go
Normal file
|
@ -0,0 +1,35 @@
|
|||
package filetransfer
|
||||
|
||||
import (
|
||||
"github.com/demodesk/neko/pkg/types"
|
||||
)
|
||||
|
||||
type Plugin struct {
|
||||
config *Config
|
||||
manager *Manager
|
||||
}
|
||||
|
||||
func NewPlugin() *Plugin {
|
||||
return &Plugin{
|
||||
config: &Config{},
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Plugin) Name() string {
|
||||
return PluginName
|
||||
}
|
||||
|
||||
func (p *Plugin) Config() types.PluginConfig {
|
||||
return p.config
|
||||
}
|
||||
|
||||
func (p *Plugin) Start(m types.PluginManagers) error {
|
||||
p.manager = NewManager(m.SessionManager, p.config)
|
||||
m.ApiManager.AddRouter("/filetransfer", p.manager.Route)
|
||||
m.WebSocketManager.AddHandler(p.manager.WebSocketHandler)
|
||||
return p.manager.Start()
|
||||
}
|
||||
|
||||
func (p *Plugin) Shutdown() error {
|
||||
return p.manager.Shutdown()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue