config.go 439 B

12345678910111213141516
  1. package imagefetcher
  2. import "github.com/imgproxy/imgproxy/v3/config"
  3. // Config holds the configuration for the image fetcher.
  4. type Config struct {
  5. // MaxRedirects is the maximum number of redirects to follow when fetching an image.
  6. MaxRedirects int
  7. }
  8. // NewConfigFromEnv creates a new Config instance from environment variables or defaults.
  9. func NewConfigFromEnv() *Config {
  10. return &Config{
  11. MaxRedirects: config.MaxRedirects,
  12. }
  13. }