init.go 431 B

1234567891011121314151617181920212223242526
  1. package cluster
  2. import (
  3. "sync"
  4. "github.com/langgenius/dify-plugin-daemon/internal/types/app"
  5. )
  6. type Cluster struct {
  7. port uint16
  8. plugins map[string]*PluginLifeTime
  9. plugin_lock sync.Mutex
  10. }
  11. func NewCluster(config *app.Config) *Cluster {
  12. return &Cluster{
  13. port: uint16(config.ServerPort),
  14. plugins: make(map[string]*PluginLifeTime),
  15. }
  16. }
  17. func (c *Cluster) Launch(config *app.Config) {
  18. go c.clusterLifetime()
  19. }