Documentation
¶
Index ¶
- Constants
- Variables
- func DhtQuery(cid string) []map[string]interface{}
- func GenerateBucketQuery(iterations int, startingCid string) ([256]string, error)
- func GetMyCid() string
- func GraphsServe(port string)
- func SetGraphDb(db Database)
- type Connection
- type Connections
- type Database
- type DhtQueryLog
- type DhtQueryRecursionElem
- type Peer
- type PeerGeolocation
- type Query
Constants ¶
View Source
const ( DWrite = "write" DRead = "read" DReadAll = "readall" DBPosition = ".database" )
Variables ¶
View Source
var DateLayout = "2006-01-02_15-04-05"
date layout
Functions ¶
func GenerateBucketQuery ¶
func GraphsServe ¶
func GraphsServe(port string)
func SetGraphDb ¶
func SetGraphDb(db Database)
Types ¶
type Connection ¶
struct representing a connection data in a specific time
type Connections ¶
type Connections []Connection
func (Connections) Len ¶
func (c Connections) Len() int
func (Connections) Less ¶
func (c Connections) Less(i, j int) bool
func (Connections) Swap ¶
func (c Connections) Swap(i, j int)
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
struct representing the database, must be a singleton
type DhtQueryLog ¶
type DhtQueryLog struct {
Timestamp string `json:"timestamp"`
StartingCid string `json:"startingCid"`
BucketId int `json:"BucketId"`
DhtRecursionList []DhtQueryRecursionElem `json:"dhtRecursionList"`
}
struct representing the recursion list of the command dht query in a specific moment
func GetDhtQueryRecursionList ¶
func GetDhtQueryRecursionList(cid string, geolocation PeerGeolocation) DhtQueryLog
using dht query ipfs command, try to explore the recursion
type DhtQueryRecursionElem ¶
type Peer ¶
type Peer struct {
Addr string `json:"Addr"`
Cid string `json:"Cid"`
Latency string `json:"Latency"`
Nation string `json:"Nation"`
City string `json:"City"`
Lat float32 `json:"Lat"`
Lon float32 `json:"Lon"`
}
struct reperesenting the peer
func SwarmStatusList ¶
func SwarmStatusList() []Peer
using ipfs HTTP api -> gets the list of the current connected peer to the swarm
type PeerGeolocation ¶
type PeerGeolocation struct {
// contains filtered or unexported fields
}
func (*PeerGeolocation) Init ¶
func (p *PeerGeolocation) Init(ip4dbloc string, ip6dbloc string) error
func (*PeerGeolocation) SetPeerCity ¶
func (p *PeerGeolocation) SetPeerCity(peer *Peer)
Given a peer -> set to the Peer the City and the Country from his ip address
Click to show internal directories.
Click to hide internal directories.