Documentation ¶
Index ¶
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 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 uint `json:"date_entered,omitempty" db:"date_entered"` 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"` }
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"` }
QueryNodes represents database query parameters
type QueryProbers ¶
Click to show internal directories.
Click to hide internal directories.