mirror of
https://github.com/sot-tech/mochi.git
synced 2026-06-18 10:29:46 -07:00
config.yaml: camelCase to snake_case
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
tracker.RegisterAnnounceMiddleware("IPBlacklist", blacklistAnnounceIP)
|
||||
tracker.RegisterAnnounceMiddleware("ip_blacklist", blacklistAnnounceIP)
|
||||
}
|
||||
|
||||
// ErrBlockedIP is returned by an announce middleware if any of the announcing
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
tracker.RegisterAnnounceMiddleware("IPWhitelist", whitelistAnnounceIP)
|
||||
tracker.RegisterAnnounceMiddleware("ip_whitelist", whitelistAnnounceIP)
|
||||
}
|
||||
|
||||
// whitelistAnnounceIP provides a middleware that only allows IPs to announce
|
||||
|
||||
+10
-10
@@ -58,16 +58,16 @@ func constructor(srvcfg *config.ServerConfig, tkr *tracker.Tracker) (server.Serv
|
||||
|
||||
type Config struct {
|
||||
Addr string `yaml:"addr"`
|
||||
RequestTimeout time.Duration `yaml:"requestTimeout"`
|
||||
ReadTimeout time.Duration `yaml:"readTimeout"`
|
||||
WriteTimeout time.Duration `yaml:"writeTimeout"`
|
||||
GCAfter time.Duration `yaml:"gcAfter"`
|
||||
ClientStore string `yaml:"clientStore"`
|
||||
ClientStoreConfig interface{} `yaml:"clienStoreConfig"`
|
||||
PeerStore string `yaml:"peerStore"`
|
||||
PeerStoreConfig interface{} `yaml:"peerStoreConfig"`
|
||||
IPStore string `yaml:"ipStore"`
|
||||
IPStoreConfig interface{} `yaml:"ipStoreConfig"`
|
||||
RequestTimeout time.Duration `yaml:"request_timeout"`
|
||||
ReadTimeout time.Duration `yaml:"read_timeout"`
|
||||
WriteTimeout time.Duration `yaml:"write_timeout"`
|
||||
GCAfter time.Duration `yaml:"gc_after"`
|
||||
ClientStore string `yaml:"client_store"`
|
||||
ClientStoreConfig interface{} `yaml:"client_store_config"`
|
||||
PeerStore string `yaml:"peer_store"`
|
||||
PeerStoreConfig interface{} `yaml:"peer_store_config"`
|
||||
IPStore string `yaml:"ip_store"`
|
||||
IPStoreConfig interface{} `yaml:"ip_store_config"`
|
||||
}
|
||||
|
||||
func newConfig(srvcfg interface{}) (*Config, error) {
|
||||
|
||||
Reference in New Issue
Block a user