Documentation ¶
Index ¶
- Constants
- Variables
- func CacheableURIPrefixes() map[string][]*url.URL
- func DeprecateFlags(cmd *cobra.Command, deprecations ...DeprecatedFlag) error
- func GetCacheSRV() string
- func GetConsumer() (consumer.Consumer, error)
- func HideFlags(cmd *cobra.Command, flags ...string) error
- func PersistentStartupProcessFlags() error
- func ResolveOverridesToMap(resolveOverrides []string) (map[string]string, error)
- func ViperInit()
- type ConsistentHashingStrategy
- type DeprecatedFlag
Constants ¶
View Source
const ( ConsumerFile = "file" ConsumerTarExtractor = "tar-extractor" ConsumerNull = "null" )
View Source
const ( // these options are a massive hack. They're only availabe via // envvar, not command line OptCacheNodesSRVNameByHostCIDR = "cache-nodes-srv-name-by-host-cidr" OptCacheNodesSRVName = "cache-nodes-srv-name" OptCacheURIPrefixes = "cache-uri-prefixes" OptCacheUsePathProxy = "cache-use-path-proxy" OptHostIP = "host-ip" // Normal options with CLI arguments OptConcurrency = "concurrency" OptConnTimeout = "connect-timeout" OptChunkSize = "chunk-size" OptExtract = "extract" OptForce = "force" OptForceHTTP2 = "force-http2" OptLoggingLevel = "log-level" OptMaxChunks = "max-chunks" OptMaxConnPerHost = "max-conn-per-host" OptMaxConcurrentFiles = "max-concurrent-files" OptMinimumChunkSize = "minimum-chunk-size" OptOutputConsumer = "output" OptPIDFile = "pid-file" OptResolve = "resolve" OptRetries = "retries" OptVerbose = "verbose" )
Variables ¶
View Source
var (
DefaultCacheURIPrefixes = []string{"https://weights.replicate.delivery"}
)
Functions ¶
func CacheableURIPrefixes ¶ added in v0.6.0
CacheableURIPrefixes returns a map of cache URI prefixes to send through consistent hash, if set. ENV is `PGET_CACHE_URI_PREFIXES`, and the format is `https://example.com/prefix1 https://example.com/prefix2 https://example.com/ [...]`
func DeprecateFlags ¶ added in v0.3.2
func DeprecateFlags(cmd *cobra.Command, deprecations ...DeprecatedFlag) error
func GetCacheSRV ¶ added in v0.3.2
func GetCacheSRV() string
GetCacheSRV returns the SRV name of the cache to use, if set.
func GetConsumer ¶ added in v0.3.2
GetConsumer returns the consumer specified by the user on the command line or an error if the consumer is invalid. Note that this function explicitly calls viper.GetString(OptExtract) internally.
func PersistentStartupProcessFlags ¶
func PersistentStartupProcessFlags() error
func ResolveOverridesToMap ¶ added in v0.4.0
Types ¶
type ConsistentHashingStrategy ¶ added in v0.4.0
type ConsistentHashingStrategy struct{}
var ConsistentHashingStrategyKey ConsistentHashingStrategy
type DeprecatedFlag ¶ added in v0.3.2
Click to show internal directories.
Click to hide internal directories.