Documentation ¶
Overview ¶
Package conf implements configuration read methods.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewContext ¶
NewContext returns a new Context carrying Config.
Types ¶
type Config ¶
type Config struct { Domain domain `json:"domain"` Listener listener `json:"listener"` Settings settings `json:"settings"` Db MongoCfg `json:"database"` Cache cache `json:"cache"` Debug bool `json:"debug"` Conn *Conn GeoDB *geoip2.Reader L Logger }
Config is main configuration storage.
func FromContext ¶
FromContext extracts the Config from Context.
func (*Config) CacheTpl ¶
CacheTpl return HTML template from file, but first tries to find it in the LRU cache.
type MongoCfg ¶
type MongoCfg struct { Hosts []string `json:"hosts"` Port uint `json:"port"` Timeout uint `json:"timeout"` Username string `json:"username"` Password string `json:"password"` Database string `json:"database"` AuthDB string `json:"authdb"` ReplicaSet string `json:"replica"` Ssl bool `json:"ssl"` SslKeyFile string `json:"sslkeyfile"` Reconnects int `json:"reconnects"` RcnTime int64 `json:"rcntime"` PoolLimit int `json:"poollimit"` Debug bool `json:"debug"` MongoCred *mgo.DialInfo Logger *log.Logger }
MongoCfg is database configuration settings
Click to show internal directories.
Click to hide internal directories.