Documentation ¶
Index ¶
- func Alive(announcetime, scrubTime, maxtime time.Duration) []node.Option
- func AliveNetworkService(announcetime, scrubTime, maxtime time.Duration) node.NetworkService
- func AnnounceDNSRecord(ctx context.Context, b *blockchain.Ledger, announcetime time.Duration, ...)
- func AvailableNodes(b *blockchain.Ledger, maxTime time.Duration) (active []string)
- func ConnectNetworkService(announcetime time.Duration, serviceID string, srcaddr string) node.NetworkService
- func DNS(ll log.StandardLogger, listenAddr string, forwarder bool, forward []string, ...) []node.Option
- func DNSNetworkService(ll log.StandardLogger, listenAddr string, forwarder bool, forward []string, ...) node.NetworkService
- func Egress(announceTime time.Duration) []node.Option
- func EgressService(announceTime time.Duration) node.NetworkService
- func ExposeNetworkService(announcetime time.Duration, serviceID string) node.NetworkService
- func PersistDNSRecord(ctx context.Context, b *blockchain.Ledger, announcetime, timeout time.Duration, ...)
- func Proxy(announceTime, deadtime time.Duration, listenAddr string) []node.Option
- func ProxyService(announceTime time.Duration, listenAddr string, deadtime time.Duration) node.NetworkService
- func QueryDNS(ctx context.Context, msg *dns.Msg, dnsServer string) (*dns.Msg, error)
- func ReceiveFile(ctx context.Context, ledger *blockchain.Ledger, n *node.Node, ...) error
- func RegisterService(ll log.StandardLogger, announcetime time.Duration, ...) []node.Option
- func ShareFile(ll log.StandardLogger, announcetime time.Duration, fileID, filepath string) ([]node.Option, error)
- func SharefileNetworkService(announcetime time.Duration, fileID string) node.NetworkService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Alive ¶ added in v0.7.2
Alive announce the node every announce time, with a periodic scrub time for healthchecks the maxtime is the time used to determine when a node is unreachable (after maxtime, its unreachable)
func AliveNetworkService ¶ added in v0.8.6
func AliveNetworkService(announcetime, scrubTime, maxtime time.Duration) node.NetworkService
func AnnounceDNSRecord ¶ added in v0.8.4
func AnnounceDNSRecord(ctx context.Context, b *blockchain.Ledger, announcetime time.Duration, regex string, record types.DNS)
AnnounceDNSRecord is syntatic sugar around the ledger Announces a DNS record binding to the blockchain, and keeps announcing for the ctx lifecycle
func AvailableNodes ¶ added in v0.7.2
func AvailableNodes(b *blockchain.Ledger, maxTime time.Duration) (active []string)
AvailableNodes returns the available nodes which sent a healthcheck in the last maxTime
func ConnectNetworkService ¶ added in v0.9.2
func ConnectNetworkService(announcetime time.Duration, serviceID string, srcaddr string) node.NetworkService
ConnectNetworkService returns a network service that binds to a service
func DNS ¶ added in v0.8.4
func DNS(ll log.StandardLogger, listenAddr string, forwarder bool, forward []string, cacheSize int) []node.Option
DNS returns a network service binding a dns blockchain resolver on listenAddr. Takes an associated name for the addresses in the blockchain
func DNSNetworkService ¶ added in v0.8.6
func EgressService ¶ added in v0.9.2
func EgressService(announceTime time.Duration) node.NetworkService
func ExposeNetworkService ¶ added in v0.8.6
func ExposeNetworkService(announcetime time.Duration, serviceID string) node.NetworkService
func PersistDNSRecord ¶ added in v0.8.4
func PersistDNSRecord(ctx context.Context, b *blockchain.Ledger, announcetime, timeout time.Duration, regex string, record types.DNS)
PersistDNSRecord is syntatic sugar around the ledger It persists a DNS record to the blockchain until it sees it reconciled. It automatically stop announcing and it is not *guaranteed* to persist data.
func ProxyService ¶ added in v0.9.2
func ProxyService(announceTime time.Duration, listenAddr string, deadtime time.Duration) node.NetworkService
ProxyService starts a local http proxy server which redirects requests to egresses into the network It takes a deadtime to consider hosts which are alive within a time window
func QueryDNS ¶ added in v0.8.4
QueryDNS queries a dns server with a dns message and return the answer it is blocking.
func ReceiveFile ¶
func RegisterService ¶ added in v0.7.2
func RegisterService(ll log.StandardLogger, announcetime time.Duration, serviceID, dstaddress string) []node.Option
ExposeService exposes a service to the p2p network. meant to be called before a node is started with Start()
func ShareFile ¶
func ShareFile(ll log.StandardLogger, announcetime time.Duration, fileID, filepath string) ([]node.Option, error)
ShareFile shares a file to the p2p network. meant to be called before a node is started with Start()
func SharefileNetworkService ¶ added in v0.8.6
func SharefileNetworkService(announcetime time.Duration, fileID string) node.NetworkService
Types ¶
This section is empty.