Documentation ¶
Overview ¶
sks_spider is a tool to spider the PGP SKS keyserver mesh.
A more introductory overview for usage should be in "README.md", as this code is geared for use as a program, not as a library.
At present, the code is heavily geared towards providing one daemon, sks_stats_daemon. This is a web-server which goes to a seed SKS server, grabs stats, and spiders out from there.
The results are available over HTTP, with pages for humans and pages for automated retrieval. The author successfully builds DNS zones using tools running out of cron which get their data from this server.
Index ¶
- Constants
- Variables
- func CountryForIPString(ipstr string) (country string, err error)
- func DummySpiderForDiagnosticsChannel()
- func GenerateDepthSorted(hostmap HostMap) []string
- func GenerateHostlistSorted(hostMap HostMap) []string
- func GetCurrentHostlist() []string
- func GetMembershipAsNodemap() (map[string]*SksNode, error)
- func GetMembershipHosts() ([]string, error)
- func HostSort(victim []string)
- func IPDisallowed(ipstr string) bool
- func KillDummySpiderForDiagnosticsChannel()
- func Main()
- func NodeUrl(name string, sn *SksNode) string
- func ReverseStringSlice(a []string)
- func SetCurrentPersisted(p *PersistedHostInfo)
- func SpiderDiagnostics(out io.Writer)
- type AliasMap
- type CountryResult
- type CountrySet
- type DnsResult
- type GraphvizAttributes
- type HostGraph
- func (hg *HostGraph) AllPeersOf(name string) []string
- func (hg *HostGraph) ExistsLink(from, to string) bool
- func (hg *HostGraph) Inbound(name string) <-chan string
- func (hg *HostGraph) LabelMutualWithBase(name string) string
- func (hg *HostGraph) Len() int
- func (hg *HostGraph) Outbound(name string) <-chan string
- type HostMap
- type HostResult
- type HostsRequest
- type IPCountryMap
- type PersistedHostInfo
- type SksNode
- type SksVersion
- type Spider
Constants ¶
const ( ContentTypeTextPlain = "text/plain; charset=UTF-8" ContentTypeJson = "application/json" )
const QUEUE_DEPTH int = 100
const SERVE_PREFIX = "/sks-peers"
Variables ¶
var BlacklistedHosts = map[string]bool{}
slow slow slow to fail
var Log *log.Logger
var VersionString string
Functions ¶
func CountryForIPString ¶
func DummySpiderForDiagnosticsChannel ¶
func DummySpiderForDiagnosticsChannel()
func GenerateDepthSorted ¶
func GenerateHostlistSorted ¶
func GetCurrentHostlist ¶
func GetCurrentHostlist() []string
func GetMembershipAsNodemap ¶
func GetMembershipHosts ¶
func HostSort ¶
func HostSort(victim []string)
Sort a list of strings in host order, ie by DNS label from right to left
func IPDisallowed ¶
func KillDummySpiderForDiagnosticsChannel ¶
func KillDummySpiderForDiagnosticsChannel()
func ReverseStringSlice ¶
func ReverseStringSlice(a []string)
func SetCurrentPersisted ¶
func SetCurrentPersisted(p *PersistedHostInfo)
func SpiderDiagnostics ¶
Types ¶
type AliasMap ¶
func GetAliasMapForHostmap ¶
type CountryResult ¶
type CountryResult struct {
// contains filtered or unexported fields
}
type CountrySet ¶
type CountrySet sortedSet
func NewCountrySet ¶
func NewCountrySet(s string) CountrySet
func (CountrySet) HasCountry ¶
func (cs CountrySet) HasCountry(s string) bool
func (CountrySet) Initialized ¶
func (cs CountrySet) Initialized() bool
func (CountrySet) String ¶
func (cs CountrySet) String() string
type GraphvizAttributes ¶
type GraphvizAttributes map[string]interface{}
func (GraphvizAttributes) String ¶
func (ga GraphvizAttributes) String() string
type HostGraph ¶
type HostGraph struct {
// contains filtered or unexported fields
}
func GenerateGraph ¶
func NewHostGraph ¶
func (*HostGraph) AllPeersOf ¶
func (*HostGraph) ExistsLink ¶
func (*HostGraph) LabelMutualWithBase ¶
type HostMap ¶
func GetCurrentHosts ¶
func GetCurrentHosts() HostMap
func LoadJSONFromFile ¶
func (HostMap) DumpJSONToFile ¶
type HostResult ¶
type HostResult struct {
// contains filtered or unexported fields
}
type HostsRequest ¶
type HostsRequest struct {
// contains filtered or unexported fields
}
type IPCountryMap ¶
func GetFreshCountryForHostmap ¶
func GetFreshCountryForHostmap(hostMap HostMap) IPCountryMap
type PersistedHostInfo ¶
type PersistedHostInfo struct { HostMap HostMap AliasMap AliasMap IPCountryMap IPCountryMap Sorted []string DepthSorted []string Graph *HostGraph Timestamp time.Time }
func GeneratePersistedInformation ¶
func GeneratePersistedInformation(spider *Spider) *PersistedHostInfo
func GetCurrentPersisted ¶
func GetCurrentPersisted() *PersistedHostInfo
func (*PersistedHostInfo) LogInformation ¶
func (p *PersistedHostInfo) LogInformation()
func (*PersistedHostInfo) UpdateStatsCounters ¶
func (p *PersistedHostInfo) UpdateStatsCounters(spider *Spider)
type SksNode ¶
type SksNode struct { // Be sure that types of Exported fields are loadable from JSON! Hostname string Port int Status string ServerHeader string ViaHeader string Settings map[string]string GossipPeers map[string]string GossipPeerList []string MailsyncPeers []string Version string Software string Keycount int // And these are populated when converted into a HostMap AnalyzeError string IpList []string Aliases []string Distance int // contains filtered or unexported fields }
type SksVersion ¶
func NewSksVersion ¶
func NewSksVersion(s string) *SksVersion
func (*SksVersion) IsAtLeast ¶
func (sv *SksVersion) IsAtLeast(min *SksVersion) bool
func (*SksVersion) String ¶
func (sv *SksVersion) String() string
type Spider ¶
type Spider struct {
// contains filtered or unexported fields
}
This persists for the length of one data gathering run.
func StartSpider ¶
func StartSpider() *Spider
func (*Spider) BatchAddHost ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
internal
|
|
string_set
Package b implements a B+tree.
|
Package b implements a B+tree. |