Documentation ¶
Index ¶
- Constants
- func NewAllEnabled() []engines.Name
- func NewGeneral() []engines.Name
- func NewImage() []engines.Name
- func NewInfo() []engines.Name
- func NewScience() []engines.Name
- func NewSettings() map[engines.Name]Settings
- type Badger
- type Cache
- type Category
- type Config
- type EngineRanking
- type Proxy
- type ProxyTimeouts
- type Ranking
- type ReaderCache
- type ReaderCategory
- type ReaderConfig
- type ReaderEngine
- type ReaderProxy
- type ReaderProxyTimeouts
- type ReaderServer
- type ReaderTTL
- type ReaderTimings
- type Redis
- type Server
- type Settings
- type TTL
- type Timings
Constants ¶
const DefaultLocale string = "en_US"
Variables ¶
This section is empty.
Functions ¶
func NewAllEnabled ¶
func NewGeneral ¶ added in v0.10.0
func NewScience ¶ added in v0.10.0
func NewSettings ¶
Types ¶
type Badger ¶ added in v0.10.0
type Badger struct { // setting this to false will result in badger not persisting the cache to disk // that means that badger will run in memory only Persist bool `koanf:"persist"` }
type Config ¶
type EngineRanking ¶
type Proxy ¶ added in v0.13.0
type Proxy struct { Salt string Timeouts ProxyTimeouts }
type ProxyTimeouts ¶ added in v0.13.0
type Ranking ¶
type Ranking struct { REXP float64 `koanf:"rexp"` A float64 `koanf:"a"` B float64 `koanf:"b"` C float64 `koanf:"c"` D float64 `koanf:"d"` TRA float64 `koanf:"tra"` TRB float64 `koanf:"trb"` TRC float64 `koanf:"trc"` TRD float64 `koanf:"trd"` Engines map[string]EngineRanking `koanf:"engines"` }
func EmptyRanking ¶ added in v0.10.0
func EmptyRanking() Ranking
func NewRanking ¶
func NewRanking() Ranking
type ReaderCache ¶ added in v0.10.0
type ReaderCache struct { // can be "none", "badger" or "redis" Type string `koanf:"type"` // has no effect if Type is "none" TTL ReaderTTL `koanf:"ttl"` // badger specific settings Badger Badger `koanf:"badger"` // redis specific settings Redis Redis `koanf:"redis"` }
ReaderCache is format in which the config is read from the config file
type ReaderCategory ¶
type ReaderCategory struct { REngines map[string]ReaderEngine `koanf:"engines"` Ranking Ranking `koanf:"ranking"` RTimings ReaderTimings `koanf:"timings"` }
ReaderCategory is format in which the config is read from the config file
type ReaderConfig ¶
type ReaderConfig struct { Server ReaderServer `koanf:"server"` RCategories map[category.Name]ReaderCategory `koanf:"categories"` Settings map[string]Settings `koanf:"settings"` }
ReaderConfig is format in which the config is read from the config file
type ReaderEngine ¶
type ReaderEngine struct {
Enabled bool `koanf:"enabled"`
}
ReaderEngine is format in which the config is read from the config file
type ReaderProxy ¶ added in v0.13.0
type ReaderProxy struct { Salt string `koanf:"salt"` Timeouts ReaderProxyTimeouts `koanf:"timeouts"` }
type ReaderProxyTimeouts ¶ added in v0.13.0
type ReaderServer ¶ added in v0.10.0
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, comma separated (wildcards allowed) and converted into slice FrontendUrls string `koanf:"frontendurls"` // cache settings Cache ReaderCache `koanf:"cache"` // salt used for image proxy Proxy ReaderProxy `koanf:"proxy"` }
ReaderServer is format in which the config is read from the config file
type ReaderTTL ¶ added in v0.10.0
type ReaderTTL struct { // how long to store the results in cache // setting this to 0 caches the results forever // to disable caching set conf.Cache.Type to "none" Time string `koanf:"time"` // if the remaining TTL when retrieving from cache is less than this, update the cache entry and reset the TTL // setting this to 0 disables this feature // setting this to the same value (or higher) as Results will update the cache entry every time RefreshTime string `koanf:"refreshtime"` }
ReaderTTL is format in which the config is read from the config file in <number><unit> format example: 1s, 1m, 1h, 1d, 1w, 1M, 1y if unit is not specified, it is assumed to be milliseconds
type ReaderTimings ¶
type ReaderTimings struct { PreferredTimeout uint `koanf:"preferredtimeout"` PreferredTimeoutResults int `koanf:"preferredtimeoutresults"` AdditionalTimeout uint `koanf:"additionaltimeout"` HardTimeout uint `koanf:"hardtimeout"` Timeout uint `koanf:"timeout"` PageTimeout uint `koanf:"pagetimeout"` Delay uint `koanf:"delay"` RandomDelay uint `koanf:"randomdelay"` Parallelism int `koanf:"parallelism"` }
ReaderTimings is format in which the config is read from the config file in miliseconds
type Timings ¶
type Timings struct { // preferred timeout if enough results are found PreferredTimeout time.Duration // number of results which if not met will trigger the additional timeout PreferredTimeoutResults int // additional timeout if not enough results are found (delay after which the number of results is checked) AdditionalTimeout time.Duration // hard timeout after which the search is forcefully stopped HardTimeout time.Duration // colly settings Timeout time.Duration PageTimeout time.Duration Delay time.Duration RandomDelay time.Duration Parallelism int }
Delegates Timeout, PageTimeout to colly.Collector.SetRequestTimeout(); Note: See https://github.com/gocolly/colly/issues/644 Delegates Delay, RandomDelay, Parallelism to colly.Collector.Limit()