Documentation ¶
Index ¶
- Constants
- type AuthorityConfig
- type Config
- type ConfigHolder
- type ErrNotStarted
- type ErrResponseTimeout
- type Event
- type EventType
- type ExitAddress
- type FailureNotifier
- type Feedback
- type Geo
- 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 TorHash
- type TorNode
Constants ¶
View Source
const ( ModuleTypeNSnitch = iota ModuleTypeRecursor ModuleTypeAuthority ModuleTypeUnknown )
View Source
const ( KEY_NAME = "name" KEY_DATA = "data" KEY_HOSTNAME = "hostname" )
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 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 ¶
This section is empty.
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 }
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 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 Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
func StartLimiter ¶
type NSnitchConfig ¶
type NSnitchConfig struct { Base Config ConfigFile string Domains map[string]*ServerDomain Node NodeConfig RedirectMode string WordListPath string CorsDomains []string Blacklists []string BlacklistTTL int64 }
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 // 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 TorHash ¶
type TorHash struct {
// contains filtered or unexported fields
}
func NewTorHash ¶
func NewTorHash() *TorHash
Click to show internal directories.
Click to hide internal directories.