Documentation
¶
Index ¶
Constants ¶
View Source
const ( MinimalReloadSeconds = 60 // one minute MaxReloadSeconds = 2 * 24 * 60 * 60 // two days CountryPfxDigits = 3 // Maximal length of local phone numbers (i.e. w/o country prefix) // Numbers which are of this length or shorter will be treated as local numbers. LocalPhoneNumberMax = 7 // Minimal length of local phone numbers (i.e. w/o country prefix) // This guarantees that numbers with the minimal length are not assumed to be // local numbers even if they have a country prefix. LocalPhoneNumberMin = LocalPhoneNumberMax - CountryPfxDigits + 1 )
Variables ¶
This section is empty.
Functions ¶
func ValidateCountryPrefix ¶
func ValidateSources ¶
func ValidateURL ¶
Types ¶
type Config ¶
type Config struct {
// Generally applicable.
Sources []string `json:"sources"`
SysInfoURL string `json:"sysinfo_url"`
Server bool `json:"server,omitempty"`
LDAPServer bool `json:"ldap_server"`
SIPServer bool `json:"sip_server"`
WebServer bool `json:"web_server"`
IncludeRoutable bool `json:"include_routable"`
CountryPrefix string `json:"country_prefix"`
Debug bool `json:"debug"`
AllowRuntimeConfigChanges bool `json:"allow_runtime_config_changes"`
AllowPermanentConfigChanges bool `json:"allow_permanent_config_changes"`
// Only relevant when running in non-server / ad-hoc mode.
Path string `json:"path"`
Formats []string `json:"formats"`
Targets []string `json:"targets"`
Resolve bool `json:"resolve"`
IndicateActive bool `json:"indicate_active"`
FilterInactive bool `json:"filter_inactive"`
ActivePfx string `json:"active_pfx"`
// Only relevant when running in server mode.
Port int `json:"port"`
Cache string `json:"cache"`
ReloadSeconds int `json:"reload_seconds"`
Reload time.Duration `json:"-"`
WebUser string `json:"web_user"`
WebPwd string `json:"web_pwd"`
UpdateURLs []string `json:"update_urls"`
// Only relevant when LDAP server is on.
LDAPPort int `json:"ldap_port"`
LDAPUser string `json:"ldap_user"`
LDAPPwd string `json:"ldap_pwd"`
// Only relevant when SIP server is on.
SIPPort int `json:"sip_port"`
}
func ReadFromJSON ¶
func (*Config) GetGlobalNumber ¶
func (*Config) GetLocalNumber ¶
func (*Config) IsLocalNumber ¶
Click to show internal directories.
Click to hide internal directories.