mirror of
https://github.com/langgenius/dify-plugin-daemon.git
synced 2026-07-23 10:15:22 -04:00
27 lines
514 B
Go
27 lines
514 B
Go
package constants
|
|
|
|
import (
|
|
"github.com/go-playground/validator/v10"
|
|
"github.com/langgenius/dify-plugin-daemon/pkg/validators"
|
|
)
|
|
|
|
type Language string
|
|
|
|
const (
|
|
Python Language = "python"
|
|
Go Language = "go" // not supported yet
|
|
)
|
|
|
|
func isAvailableLanguage(fl validator.FieldLevel) bool {
|
|
value := fl.Field().String()
|
|
switch value {
|
|
case string(Python):
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func init() {
|
|
validators.GlobalEntitiesValidator.RegisterValidation("is_available_language", isAvailableLanguage)
|
|
}
|