Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultListenAddress = "127.0.0.1:8080" DefaultRedisAddr = "127.0.0.1:6379" DefaultQueue = "default" DefaultConcurrency = 10 DefaultJobsPath = "/__jobs" DefaultTaskRetention = Duration(1 * time.Hour) DefaultUpstreamTimeout = Duration(5 * time.Minute) DefaultMaxBodySize int64 = 10 << 20 // 10MB DefaultDirectProxyThreshold int64 = 10 << 20 DefaultCacheMaxEntries = 10000 DefaultCacheRedisKeyPrefix = "proxq:" DefaultCacheTTL = Duration(5 * time.Minute) )
Variables ¶
View Source
var ( ErrNoUpstreams = errors.New( "at least one upstream required", ) ErrRootWithMultipleUpstreams = errors.New( "root prefix \"/\" only allowed with a single upstream", ) ErrNestedPrefixes = errors.New( "upstream prefixes must not overlap", ) ErrPrefixConflictsWithJobsPath = errors.New( "upstream prefix conflicts with jobs path", ) )
Functions ¶
This section is empty.
Types ¶
type CacheConfig ¶
type Config ¶
type Config struct {
ListenAddress string `yaml:"listenAddress"`
Redis RedisConfig `yaml:"redis"`
Queue string `yaml:"queue"`
Concurrency int `yaml:"concurrency"`
JobsPath string `yaml:"jobsPath"`
TaskRetention Duration `yaml:"taskRetention"`
Cache CacheConfig `yaml:"cache"`
Upstreams []Upstream `yaml:"upstreams"`
}
type DirectProxyMode ¶
type DirectProxyMode = string
const ( DirectProxyModeProxy DirectProxyMode = "proxy" DirectProxyModeRedirect DirectProxyMode = "redirect" )
type PathFilterConfig ¶
type PathFilterMode ¶
type PathFilterMode = string
const ( PathFilterModeBlacklist PathFilterMode = "blacklist" PathFilterModeWhitelist PathFilterMode = "whitelist" )
type RedisConfig ¶
type Upstream ¶
type Upstream struct {
Prefix string `yaml:"prefix"`
URL string `yaml:"url"`
Timeout Duration `yaml:"timeout"`
MaxRetries int `yaml:"maxRetries"`
RetryDelay Duration `yaml:"retryDelay"`
MaxBodySize int64 `yaml:"maxBodySize"`
DirectProxyThreshold int64 `yaml:"directProxyThreshold"` //nolint:lll
DirectProxyMode string `yaml:"directProxyMode"`
CacheKeyExcludeHeaders []string `yaml:"cacheKeyExcludeHeaders"` //nolint:lll
PathFilter PathFilterConfig `yaml:"pathFilter"`
CompiledPatterns []*regexp.Regexp `yaml:"-"`
}
Click to show internal directories.
Click to hide internal directories.