manager.go 793 B

12345678910111213141516171819202122232425262728293031323334
  1. package plugin_manager
  2. import (
  3. "github.com/langgenius/dify-plugin-daemon/internal/types/app"
  4. "github.com/langgenius/dify-plugin-daemon/internal/types/entities"
  5. "github.com/langgenius/dify-plugin-daemon/internal/utils/log"
  6. )
  7. func List() []*entities.PluginRuntime {
  8. var runtimes []*entities.PluginRuntime
  9. m.Range(func(key, value interface{}) bool {
  10. if v, ok := value.(*entities.PluginRuntime); ok {
  11. runtimes = append(runtimes, v)
  12. }
  13. return true
  14. })
  15. return runtimes
  16. }
  17. func Put(path string, binary []byte) {
  18. //TODO: put binary into
  19. }
  20. func Delete(identity string) {
  21. //TODO: delete binary from
  22. }
  23. func Init(configuration *app.Config) {
  24. // TODO: init plugin manager
  25. log.Info("start plugin manager daemon...")
  26. startWatcher(configuration.StoragePath, configuration.Platform)
  27. }