config.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 uint16 `envconfig:"PLUGIN_REMOTE_INSTALLING_PORT"`
  8. PluginRemoteInstallingEnabled bool `envconfig:"PLUGIN_REMOTE_INSTALLING_ENABLED"`
  9. PluginRemoteInstallingMaxConn int `envconfig:"PLUGIN_REMOTE_INSTALLING_MAX_CONN"`
  10. PluginRemoteInstallServerEventLoopNums int `envconfig:"PLUGIN_REMOTE_INSTALL_SERVER_EVENT_LOOP_NUMS"`
  11. StoragePath string `envconfig:"STORAGE_PATH"`
  12. ProcessCachingPath string `envconfig:"PROCESS_CACHING_PATH"`
  13. Platform PlatformType `envconfig:"PLATFORM"`
  14. RoutinePoolSize int `envconfig:"ROUTINE_POOL_SIZE"`
  15. RedisHost string `envconfig:"REDIS_HOST"`
  16. RedisPort int16 `envconfig:"REDIS_PORT"`
  17. RedisPass string `envconfig:"REDIS_PASS"`
  18. LifetimeCollectionHeartbeatInterval int `envconfig:"LIFETIME_COLLECTION_HEARTBEAT_INTERVAL"`
  19. LifetimeCollectionGCInterval int `envconfig:"LIFETIME_COLLECTION_GC_INTERVAL"`
  20. LifetimeStateGCInterval int `envconfig:"LIFETIME_STATE_GC_INTERVAL"`
  21. DifyInvocationConnectionIdleTimeout int `envconfig:"DIFY_INVOCATION_CONNECTION_IDLE_TIMEOUT"`
  22. }
  23. type PlatformType string
  24. const (
  25. PLATFORM_LOCAL PlatformType = "local"
  26. PLATFORM_AWS_LAMBDA PlatformType = "aws_lambda"
  27. )