config.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package app
  2. type Config struct {
  3. SERVER_PORT int16 `envconfig:"SERVER_PORT"`
  4. PluginInnerApiKey string `envconfig:"PLUGIN_INNER_API_KEY"`
  5. PluginInnerApiURL string `envconfig:"PLUGIN_INNER_API_URL"`
  6. PluginRemoteInstallingHost string `envconfig:"PLUGIN_REMOTE_INSTALLING_HOST"`
  7. PluginRemoteInstallingPort int16 `envconfig:"PLUGIN_REMOTE_INSTALLING_PORT"`
  8. StoragePath string `envconfig:"STORAGE_PATH"`
  9. ProcessCachingPath string `envconfig:"PROCESS_CACHING_PATH"`
  10. Platform PlatformType `envconfig:"PLATFORM"`
  11. RoutinePoolSize int `envconfig:"ROUTINE_POOL_SIZE"`
  12. RedisHost string `envconfig:"REDIS_HOST"`
  13. RedisPort int16 `envconfig:"REDIS_PORT"`
  14. RedisPass string `envconfig:"REDIS_PASS"`
  15. LifetimeCollectionHeartbeatInterval int `envconfig:"LIFETIME_COLLECTION_HEARTBEAT_INTERVAL"`
  16. LifetimeCollectionGCInterval int `envconfig:"LIFETIME_COLLECTION_GC_INTERVAL"`
  17. LifetimeStateGCInterval int `envconfig:"LIFETIME_STATE_GC_INTERVAL"`
  18. DifyInvocationConnectionIdleTimeout int `envconfig:"DIFY_INVOCATION_CONNECTION_IDLE_TIMEOUT"`
  19. }
  20. type PlatformType string
  21. const (
  22. PLATFORM_LOCAL PlatformType = "local"
  23. PLATFORM_AWS_LAMBDA PlatformType = "aws_lambda"
  24. )