Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Block ¶
type Block struct { // specified by node // server should prevent collisions NodeID string `json:"node_id"` Signature string `json:"signature"` Timestamp time.Time `json:"timestamp"` // array of services the node is hosting Services []string `json:"services"` // ip address of the author of block // filled in by the receiving server // json tag for serving the ledger IP string `json:"ip"` }
sent by a node, specifies which services it has this is the data structure for internode communications
type Ledger ¶
type Ledger struct { // this defaults to the machine's host name // it is used to identify local nodes within the Ledger NodeId string `json:"node_id"` RootIP string `json:"root_ip"` SelfIP string `json:"self_ip"` // keeps track of the number of changes // since the creation of ledger Mutations int `json:"mutations"` // node hostnames and ip addresses // A and AAAA records ActiveRecords map[string][]Record `json:"active_records"` // notice that timeout is an attribute of the Ledger // and therefore an attribute of the whole network Timeout time.Duration `json:"timeout"` // contains filtered or unexported fields }
active ledger, stores the history and provides methods for quick access of active records
func ParseLedger ¶
func (*Ledger) AddBlock ¶
adds the block to the history and SRV to the map silently ignores ill-formatted addresses
Directories ¶
Path | Synopsis |
---|---|
this server keeps track of the connection in the local machine This file contains all client facing serving A reverse proxy for requests to local services A an index endpoint which replies with all services registered locally
|
this server keeps track of the connection in the local machine This file contains all client facing serving A reverse proxy for requests to local services A an index endpoint which replies with all services registered locally |
Click to show internal directories.
Click to hide internal directories.