Documentation ¶
Index ¶
- Constants
- func AsMsg(in interface{}) *dns.Msg
- func AsRR(in interface{}) []dns.RR
- func EqualTLSSupportItem(a, b *TLSSupport) bool
- func MapKey(prefix, suffix string) string
- type AuthorityConfig
- type Config
- type ConfigHolder
- type DNSCache
- type DNSCacheHolder
- func (d *DNSCacheHolder) Get(provider, key string) interface{}
- func (d *DNSCacheHolder) GetAllWithKey(provider, key string) (values []interface{})
- func (d *DNSCacheHolder) GetBool(provider, key string) (bool, bool)
- func (d *DNSCacheHolder) GetInt(provider, key string) (int, bool)
- func (d *DNSCacheHolder) GetString(provider, key string) (string, bool)
- func (d *DNSCacheHolder) Insert(provider, domain string, rr dns.RR, extra *ItemCacheExtra)
- func (d *DNSCacheHolder) InsertResponse(provider, domain string, r *dns.Msg)
- func (d *DNSCacheHolder) Put(provider, key string, value interface{})
- func (d *DNSCacheHolder) Retrieve(provider, domain string, t uint16, dnssec bool) (ret interface{}, extra *ItemCacheExtra)
- func (d *DNSCacheHolder) Stop()
- type ErrNotStarted
- type ErrResponseTimeout
- type Event
- type EventType
- type ExitAddress
- type FailureNotifier
- type Feedback
- type Geo
- type ItemCacheExtra
- type Limiter
- type NSnitchConfig
- type NodeConfig
- type Payload
- type PerSecond
- type Pool
- type Query
- type RecursorConfig
- type Runtime
- type ServerDomain
- type Stats
- func (s *Stats) AddBroadcastWatcher() chan map[string]interface{}
- func (s *Stats) Card(key, value string)
- func (s *Stats) Count(key string)
- func (s *Stats) CountN(key string, increment uint64)
- func (s *Stats) Latency(key string, value uint64)
- func (s *Stats) ListKeys(rt *Runtime) (*[]string, error)
- func (s *Stats) Stop()
- func (s *Stats) Tick(component, action_type string)
- func (s *Stats) TickN(component string, action_type string, count uint64)
- type TLSSupport
- type TorHash
- type TorNode
- type WellKnown
Constants ¶
View Source
const ( CACHE_EVICTION_RATE = 30 /// expressed in seconds CACHE_OPENNIC = "opennic" CACHE_IANA = "iana" )
View Source
const ( KV_TLS_CAPABILITY = "tlscap" KV_TLS_SUPPORTED = "tlsok" KV_TCP_PREFERENCE = "tcppref" KV_EDNS_ALLERGY = "skipedns" KV_DS_RR_NUM = "ds_rr_num" KV_DNSKEY_RR_NUM = "dnskey_rr_num" )
View Source
const ( ModuleTypeNSnitch = iota ModuleTypeRecursor ModuleTypeAuthority ModuleTypeUnknown )
View Source
const ( KEY_NAME = "name" KEY_DATA = "data" KEY_HOSTNAME = "hostname" )
View Source
const ( SPEEDTEST_MAX_FILESIZE_EXPONENT = 16 /// 2^exponent will be the resulting filesize for speedtest (basically, we have 1, 2, 4 ... 1024) SPEEDTEST_ONE_UNIT = "" /* 1024-byte string literal not displayed */ )
View Source
const ( EvtTypeCount = 1 EvtTypeCard = 2 EvtTypeLatency = 3 )
View Source
const ( STATE_NODE = iota STATE_PUBLISHED STATE_UPDATED STATE_ADDRESS )
View Source
const DB_TEMPLATE_VERSION = "geo-key-%s"
View Source
const (
ITEM_CACHE_DNSSEC_DESIGNATION = "dnssec-"
)
View Source
const KEY_GEODB_UPDATED = "geodb-updated-time"
View Source
const KEY_START_TIME = "start-time"
View Source
const LIMITER_RPS_THRESHOLD = 500
View Source
const PORT_DISABLED = -1
View Source
const PORT_UNSET = 0
View Source
const UPDATE_DELAY = time.Minute
View Source
const URL_TEMPLATE = "https://download.maxmind.com/app/geoip_download?edition_id=%s&suffix=%s&license_key=%s"
Variables ¶
This section is empty.
Functions ¶
func EqualTLSSupportItem ¶
func EqualTLSSupportItem(a, b *TLSSupport) bool
Types ¶
type AuthorityConfig ¶
type Config ¶
type Config struct { DatabasePath string DatabaseTTL int64 IncludePath string MaxmindKey string GeoDBPath string TorUrl string LookupCreds map[string]string AdminCreds map[string]string Peers map[string]anycast.Peer BGP anycast.BGPConfig Netblocks map[string]common.Netblock DefaultHttpPort int DefaultHttpsPort int DefaultDnsUdpPort int DefaultDnsTcpPort int DefaultDnsTlsPort int RateThreshold uint64 OutboundIPs []string SlackFeedback map[string]string ThreadedResolver bool }
type ConfigHolder ¶
type ConfigHolder struct { MasterConfig Config NSnitchs []NSnitchConfig Recursors []RecursorConfig Authorities []AuthorityConfig }
func ParseConfig ¶
func ParseConfig(path string, checkonly bool, ignoreplatform bool) ConfigHolder
type DNSCacheHolder ¶
type DNSCacheHolder struct {
// contains filtered or unexported fields
}
func StartCache ¶
func StartCache(log *logrus.Entry, designations ...string) *DNSCacheHolder
StartCache -- Creates, starts and returns a cache object
func (*DNSCacheHolder) Get ¶
func (d *DNSCacheHolder) Get(provider, key string) interface{}
func (*DNSCacheHolder) GetAllWithKey ¶
func (d *DNSCacheHolder) GetAllWithKey(provider, key string) (values []interface{})
func (*DNSCacheHolder) GetBool ¶
func (d *DNSCacheHolder) GetBool(provider, key string) (bool, bool)
func (*DNSCacheHolder) GetString ¶
func (d *DNSCacheHolder) GetString(provider, key string) (string, bool)
func (*DNSCacheHolder) Insert ¶
func (d *DNSCacheHolder) Insert(provider, domain string, rr dns.RR, extra *ItemCacheExtra)
func (*DNSCacheHolder) InsertResponse ¶
func (d *DNSCacheHolder) InsertResponse(provider, domain string, r *dns.Msg)
func (*DNSCacheHolder) Put ¶
func (d *DNSCacheHolder) Put(provider, key string, value interface{})
func (*DNSCacheHolder) Retrieve ¶
func (d *DNSCacheHolder) Retrieve(provider, domain string, t uint16, dnssec bool) (ret interface{}, extra *ItemCacheExtra)
func (*DNSCacheHolder) Stop ¶
func (d *DNSCacheHolder) Stop()
Stop -- stops caching (stops cleanup thread)
type ErrNotStarted ¶
type ErrNotStarted struct{}
func (*ErrNotStarted) Error ¶
func (e *ErrNotStarted) Error() string
type ErrResponseTimeout ¶
type ErrResponseTimeout struct {
// contains filtered or unexported fields
}
func (*ErrResponseTimeout) Error ¶
func (e *ErrResponseTimeout) Error() string
type ExitAddress ¶
type FailureNotifier ¶
type FailureNotifier func()
type Feedback ¶
type Feedback struct {
// contains filtered or unexported fields
}
func StartFeedback ¶
func (*Feedback) SendFeedback ¶
func (*Feedback) SendMessage ¶
type ItemCacheExtra ¶
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
func StartLimiter ¶
type NSnitchConfig ¶
type NodeConfig ¶
type NodeConfig struct { City string State string Country string CountryISO string Latitude float32 Longitude float32 ISP string AS uint Org string TimeZone string }
func (*NodeConfig) MakeNodeLoc ¶
func (cfg *NodeConfig) MakeNodeLoc() *common.GeoLocation
type Payload ¶
type Payload struct {
// contains filtered or unexported fields
}
func NewPayload ¶
func (*Payload) LongEncode ¶
func (*Payload) ShortEncode ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func StartIPPool ¶
func (*Pool) RandomizeTCPDialer ¶
func (*Pool) RandomizeUDPDialer ¶
type RecursorConfig ¶
type RecursorConfig struct { Base Config ConfigFile string Domains map[string]*ServerDomain OpenNic bool }
type Runtime ¶
type Runtime struct { DB *leveldb.DB Geo *Geo Stats *Stats IPPool *Pool RateLimiter *Limiter SlackWH *Feedback Cache *DNSCacheHolder SpeedTestFiles map[int]string // contains filtered or unexported fields }
noinspection GoNameStartsWithPackageName
func NewRuntime ¶
func (*Runtime) AddService ¶
func (rt *Runtime) AddService()
func (*Runtime) OnFinished ¶
func (rt *Runtime) OnFinished(fn finisher)
func (*Runtime) OnFinishedOrPanic ¶
func (rt *Runtime) OnFinishedOrPanic(fn finisher, pchan chan interface{})
type ServerDomain ¶
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
func StartStats ¶
func (*Stats) AddBroadcastWatcher ¶
type TLSSupport ¶
func NewTLSSupportItem ¶
func NewTLSSupportItem(hostname, ip, zone string) *TLSSupport
type TorHash ¶
type TorHash struct {
// contains filtered or unexported fields
}
func NewTorHash ¶
func NewTorHash() *TorHash
Click to show internal directories.
Click to hide internal directories.