plugin.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. package models
  2. import (
  3. "github.com/langgenius/dify-plugin-daemon/internal/types/entities/plugin_entities"
  4. )
  5. type Plugin struct {
  6. Model
  7. // PluginUniqueIdentifier is a unique identifier for the plugin, it contains version and checksum
  8. PluginUniqueIdentifier string `json:"plugin_unique_identifier" gorm:"index;size:127"`
  9. // PluginID is the id of the plugin, only plugin name is considered
  10. PluginID string `json:"id" gorm:"index;size:127"`
  11. Refers int `json:"refers" gorm:"default:0"`
  12. InstallType plugin_entities.PluginRuntimeType `json:"install_type" gorm:"size:127;index"`
  13. ManifestType plugin_entities.DifyManifestType `json:"manifest_type" gorm:"size:127"`
  14. Declaration plugin_entities.PluginDeclaration `json:"declaration" gorm:"serializer:json;type:text;size:65535"`
  15. }
  16. type ServerlessRuntimeType string
  17. const (
  18. SERVERLESS_RUNTIME_TYPE_AWS_LAMBDA ServerlessRuntimeType = "aws_lambda"
  19. )
  20. type ServerlessRuntime struct {
  21. Model
  22. PluginUniqueIdentifier string `json:"plugin_unique_identifier" gorm:"size:127;unique"`
  23. FunctionURL string `json:"function_url" gorm:"size:255"`
  24. FunctionName string `json:"function_name" gorm:"size:127"`
  25. Type ServerlessRuntimeType `json:"type" gorm:"size:127"`
  26. Declaration plugin_entities.PluginDeclaration `json:"declaration" gorm:"serializer:json;type:text;size:65535"`
  27. Checksum string `json:"checksum" gorm:"size:127;index"`
  28. }