config.go 520 B

12345678910111213141516171819202122
  1. package imagefetcher
  2. import "github.com/imgproxy/imgproxy/v3/config"
  3. type Config struct {
  4. // MaxRedirects is the maximum number of redirects to follow
  5. MaxRedirects int
  6. // UserAgent is the user agent string to use for requests
  7. UserAgent string
  8. // DownloadTimeout is the timeout for downloading images in seconds
  9. DownloadTimeout int
  10. }
  11. func NewConfigFromEnv() *Config {
  12. return &Config{
  13. MaxRedirects: config.MaxRedirects,
  14. UserAgent: config.UserAgent,
  15. DownloadTimeout: config.DownloadTimeout,
  16. }
  17. }