Documentation
¶
Index ¶
- Constants
- func New() *moneroRepo
- func NewProber() *proberRepo
- func ParseCURLGetInfo(node Node) string
- func ParseNodeStatuses(statuses types.JSONText) [5]int
- type Countries
- type FetchLog
- type FetchLogs
- type NetFee
- type Node
- type Nodes
- type ProbeReport
- type Prober
- type QueryLogs
- type QueryNodes
- type QueryProbers
- type RuckniumNodeData
Constants ¶
View Source
const ProberAPIKey = "X-Prober-Api-Key" // HTTP header key
Variables ¶
This section is empty.
Functions ¶
func NewProber ¶
func NewProber() *proberRepo
Initializes a new ProberRepository
NOTE: This "prober" is different with "probe" which is used to fetch a new job
func ParseCURLGetInfo ¶ added in v0.2.1
ParseCURLGetInfo generates curl command to get node info from given node
Primarily used for Web UI to display example curl command.
func ParseNodeStatuses ¶
ParseNodeStatuses parses JSONText into [5]int Used this to parse last_check_status for templ engine
Types ¶
type Countries ¶
type Countries struct {
TotalNodes int `json:"total_nodes" db:"total_nodes"`
CC string `json:"cc" db:"country"` // country code
Name string `json:"name" db:"country_name"`
}
Countries represents list of countries
type FetchLog ¶
type FetchLog struct {
ID int `db:"id" json:"id,omitempty"`
NodeID int `db:"node_id" json:"node_id"`
ProberID int `db:"prober_id" json:"prober_id"`
Status int `db:"is_available" json:"status"`
Height int `db:"height" json:"height"`
AdjustedTime int64 `db:"adjusted_time" json:"adjusted_time"`
DatabaseSize int `db:"database_size" json:"database_size"`
Difficulty int `db:"difficulty" json:"difficulty"`
EstimateFee int `db:"estimate_fee" json:"estimate_fee"`
DateChecked int64 `db:"date_checked" json:"date_checked"`
FailedReason string `db:"failed_reason" json:"failed_reason"`
FetchRuntime float64 `db:"fetch_runtime" json:"fetch_runtime"`
}
type Node ¶
type Node struct {
ID uint `json:"id,omitempty" db:"id"`
Hostname string `json:"hostname" db:"hostname"`
IP string `json:"ip" db:"ip_addr"`
Port uint `json:"port" db:"port"`
Protocol string `json:"protocol" db:"protocol"`
IsTor bool `json:"is_tor" db:"is_tor"`
IsI2P bool `json:"is_i2p" db:"is_i2p"`
IsAvailable bool `json:"is_available" db:"is_available"`
Nettype string `json:"nettype" db:"nettype"`
Height uint `json:"height" db:"height"`
AdjustedTime uint `json:"adjusted_time" db:"adjusted_time"`
DatabaseSize uint `json:"database_size" db:"database_size"`
Difficulty uint `json:"difficulty" db:"difficulty"`
Version string `json:"version" db:"version"`
Status string `json:"status,omitempty"`
Uptime float64 `json:"uptime" db:"uptime"`
EstimateFee uint `json:"estimate_fee" db:"estimate_fee"`
ASN uint `json:"asn" db:"asn"`
ASNName string `json:"asn_name" db:"asn_name"`
CountryCode string `json:"cc" db:"country"`
CountryName string `json:"country_name" db:"country_name"`
City string `json:"city" db:"city"`
Latitude float64 `json:"latitude" db:"lat"`
Longitude float64 `json:"longitude" db:"lon"`
DateEntered int64 `json:"date_entered,omitempty" db:"date_entered"`
SubmitterIPHash string `json:"submitter_iphash,omitempty" db:"submitter_iphash"`
LastChecked int64 `json:"last_checked" db:"last_checked"`
FailedCount uint `json:"failed_count,omitempty" db:"failed_count"`
LastCheckStatus types.JSONText `json:"last_check_statuses" db:"last_check_status"`
CORSCapable bool `json:"cors" db:"cors_capable"`
IPv6Only bool `json:"ipv6_only" db:"ipv6_only"`
IPAddresses string `json:"ip_addresses" db:"ip_addresses"`
IsArchived int `json:"is_archived" db:"is_archived"`
// Rucknium's node data
IsSpyNode int `json:"is_spy_node" db:"is_spy_node"` // 0 = no, 1 = yes, 2 = not applied
MRLBanListEnabled int `json:"mrl_ban_list_enabled" db:"mrl_ban_list_enabled"` // 0 = no, 1 = yes, 2 = not applied
DNSBanListEnabled int `json:"dns_ban_list_enabled" db:"dns_ban_list_enabled"` // 0 = no, 1 = yes, 2 = not applied
}
Node represents a single remote node
type Nodes ¶
type Nodes struct {
TotalRows int `json:"total_rows"`
TotalPages int `json:"total_pages"` // total pages
RowsPerPage int `json:"rows_per_page"`
Items []*Node `json:"items"`
}
Nodes represents a list of nodes
type ProbeReport ¶
type QueryNodes ¶
type QueryNodes struct {
paging.Paging
Host string `url:"host,omitempty"`
Nettype string `url:"nettype,omitempty"` // Can be empty string, "any", mainnet, stagenet, testnet.
Protocol string `url:"protocol,omitempty"` // Can be "any", tor, http, https. Default: "any"
CC string `url:"cc,omitempty"` // 2 letter country code
Status int `url:"status"`
CORS string `url:"cors,omitempty"`
IsArchived int `url:"archived,omitempty"`
IsSpyNode int `url:"spynode"`
MRLBan string `url:"mrlban,omitempty"`
DNSBan string `url:"dnsban,omitempty"`
}
QueryNodes represents database query parameters
type QueryProbers ¶
type RuckniumNodeData ¶ added in v0.2.3
type RuckniumNodeData struct {
ID uint `json:"id,omitempty" db:"id"`
Date string `json:"date" db:"scan_date"`
ConnectedNodeIP string `json:"connected_node_ip" db:"connected_node_ip"`
IsSpyNode int `json:"is_spy_node" db:"is_spy_node"` // 0 = no, 1 = yes, 2 = not applied
RPCDomain string `json:"rpc_domain" db:"rpc_domain"`
MRLBanListEnabled int `json:"mrl_ban_list_enabled" db:"mrl_ban_list_enabled"` // 0 = no, 1 = yes, 2 = not applied
DNSBanListEnabled int `json:"dns_ban_list_enabled" db:"dns_ban_list_enabled"` // 0 = no, 1 = yes, 2 = not applied
}
RuckniumNodeData represents a single remote node data from Rucknium's MRL ban list
Click to show internal directories.
Click to hide internal directories.