Skip to content

Commit 5193a3f

Browse files
update (#266)
1 parent 07e92a8 commit 5193a3f

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

internal/types/app/config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package app
22

33
import (
44
"fmt"
5+
"github.com/langgenius/dify-plugin-daemon/internal/oss"
56

67
"github.com/go-playground/validator/v10"
78
)
@@ -203,7 +204,7 @@ func (c *Config) Validate() error {
203204
return fmt.Errorf("plugin package cache path is empty")
204205
}
205206

206-
if c.PluginStorageType == "aws_s3" {
207+
if c.PluginStorageType == oss.OSS_TYPE_S3 {
207208
if c.PluginStorageOSSBucket == "" {
208209
return fmt.Errorf("plugin storage bucket is empty")
209210
}
@@ -213,7 +214,7 @@ func (c *Config) Validate() error {
213214
}
214215
}
215216

216-
if c.PluginStorageType == "azure_blob" {
217+
if c.PluginStorageType == oss.OSS_TYPE_AZURE_BLOB {
217218
if c.AzureBlobStorageConnectionString == "" {
218219
return fmt.Errorf("azure blob storage connection string is empty")
219220
}
@@ -223,7 +224,7 @@ func (c *Config) Validate() error {
223224
}
224225
}
225226

226-
if c.PluginStorageType == "aliyun_oss" {
227+
if c.PluginStorageType == oss.OSS_TYPE_ALIYUN_OSS {
227228
if c.PluginStorageOSSBucket == "" {
228229
return fmt.Errorf("plugin storage bucket is empty")
229230
}

internal/types/app/default.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package app
22

3-
import "golang.org/x/exp/constraints"
3+
import (
4+
"github.com/langgenius/dify-plugin-daemon/internal/oss"
5+
"golang.org/x/exp/constraints"
6+
)
47

58
func (config *Config) SetDefault() {
69
setDefaultInt(&config.ServerPort, 5002)
@@ -15,7 +18,7 @@ func (config *Config) SetDefault() {
1518
setDefaultInt(&config.MaxBundlePackageSize, 52428800*12)
1619
setDefaultInt(&config.MaxServerlessTransactionTimeout, 300)
1720
setDefaultInt(&config.PluginMaxExecutionTimeout, 10*60)
18-
setDefaultString(&config.PluginStorageType, "local")
21+
setDefaultString(&config.PluginStorageType, oss.OSS_TYPE_LOCAL)
1922
setDefaultInt(&config.PluginMediaCacheSize, 1024)
2023
setDefaultInt(&config.DifyPluginServerlessConnectorLaunchTimeout, 240)
2124
setDefaultInt(&config.PluginRemoteInstallingMaxSingleTenantConn, 5)

0 commit comments

Comments
 (0)