Documentation ¶
Index ¶
- type Cache
- type Config
- type DynamoDB
- type EngineConfig
- type Exchange
- type ExchangeTimings
- type ImageProxy
- type ReaderCache
- type ReaderConfig
- type ReaderEngineConfig
- type ReaderExchange
- type ReaderExchangeEngine
- type ReaderExchangeTimings
- type ReaderImageProxy
- type ReaderServer
- type ReaderTTL
- type Redis
- type Server
- type TTL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Server Server Engines EngineConfig Exchange Exchange }
type EngineConfig ¶ added in v0.32.0
type EngineConfig struct { NoWeb []engines.Name NoImages []engines.Name NoSuggestions []engines.Name }
Slices of disabled engines for each search type, by default these are empty.
type Exchange ¶ added in v0.26.0
type Exchange struct { BaseCurrency currency.Currency Engines []engines.Name Timings ExchangeTimings }
type ExchangeTimings ¶ added in v0.26.0
type ImageProxy ¶
type ReaderCache ¶
type ReaderCache struct { // Can be "none", "redis" or "dynamodb". Type string `koanf:"type"` // Prefix to use for cache keys. KeyPrefix string `koanf:"keyprefix"` // Has no effect if type is "none". TTL ReaderTTL `koanf:"ttl"` // Redis specific settings. Redis Redis `koanf:"redis"` // DynamoDB specific settings. DynamoDB DynamoDB `koanf:"dynamodb"` }
ReaderCache is format in which the config is read from the config file and environment variables.
type ReaderConfig ¶
type ReaderConfig struct { Server ReaderServer `koanf:"server"` REngines map[string]ReaderEngineConfig `koanf:"engines"` RExchange ReaderExchange `koanf:"exchange"` }
ReaderConfig is format in which the config is read from the config file and environment variables.
type ReaderEngineConfig ¶ added in v0.32.0
type ReaderEngineConfig struct { NoWeb bool `koanf:"noweb"` // Whether this engine is disallowed to do web searches. NoImages bool `koanf:"noimages"` // Whether this engine is disallowed to do image searches. NoSuggestions bool `koanf:"nosuggestions"` // Whether this engine is disallowed to do suggestion searches. }
ReaderEngineConfig is format in which the config is read from the config file and environment variables. Used to disable certain search types for an engine. By default, all types are enabled.
type ReaderExchange ¶ added in v0.26.0
type ReaderExchange struct { BaseCurrency string `koanf:"basecurrency"` REngines map[string]ReaderExchangeEngine `koanf:"engines"` RTimings ReaderExchangeTimings `koanf:"timings"` }
ReaderCategory is format in which the config is read from the config file and environment variables.
type ReaderExchangeEngine ¶ added in v0.26.0
type ReaderExchangeEngine struct { // If false, the engine will not be used. Enabled bool `koanf:"enabled"` }
ReaderEngine is format in which the config is read from the config file and environment variables.
type ReaderExchangeTimings ¶ added in v0.26.0
type ReaderExchangeTimings struct { // Hard timeout after which the search is forcefully stopped (even if the engines didn't respond). HardTimeout string `koanf:"hardtimeout"` }
ReaderTimings is format in which the config is read from the config file and environment variables. In <number><unit> format. Example: 1s, 1m, 1h, 1d, 1w, 1M, 1y. If unit is not specified, it is assumed to be milliseconds.
type ReaderImageProxy ¶
type ReaderImageProxy struct { SecretKey string `koanf:"secretkey"` Timeout string `koanf:"timeout"` }
ReaderProxy is format in which the config is read from the config file and environment variables. In <number><unit> format. Example: 1s, 1m, 1h, 1d, 1w, 1M, 1y. If unit is not specified, it is assumed to be milliseconds.
type ReaderServer ¶
type ReaderServer struct { // Environment in which the server is running (normal or lambda). Environment string `koanf:"environment"` // Port on which the API server listens. Port int `koanf:"port"` // URLs used for CORS (wildcards allowed). // Comma separated. FrontendUrls string `koanf:"frontendurls"` // Cache settings. Cache ReaderCache `koanf:"cache"` // Image proxy settings. ImageProxy ReaderImageProxy `koanf:"imageproxy"` }
ReaderServer is format in which the config is read from the config file and environment variables.
type ReaderTTL ¶
type ReaderTTL struct { // How long to store the currencies in cache. // Setting this to 0 caches the currencies forever. Currencies string `koanf:"currencies"` }
ReaderTTL is format in which the config is read from the config file and environment variables. In <number><unit> format. Example: 1s, 1m, 1h, 1d, 1w, 1M, 1y. If unit is not specified, it is assumed to be milliseconds.
type Server ¶
type Server struct { // Environment in which the server is running (normal or lambda). Environment string // Port on which the API server listens. Port int // URLs used for CORS (wildcards allowed). FrontendUrls []string // Cache settings. Cache Cache // Image proxy settings. ImageProxy ImageProxy }