Various documentation fixes and additions.
[quix0rs-apt-p2p.git] / apt_dht / __init__.py
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b945cecc62c30ca08dbcd6d0d80ee973236e9dcd 100644 (file)
@@ -0,0 +1,47 @@
+
+"""The main apt-dht modules.
+
+To run apt-dht, you probably want to do something like::
+
+  from apt_dht.apt_dht import AptDHT
+  myapp = AptDHT(myDHT)
+
+where myDHT is a DHT that implements interfaces.IDHT.
+
+Diagram of the interaction between the given modules::
+  
+  +---------------+    +-----------------------------------+    +-------------
+  |     AptDHT    |    |               DHT                 |    |  Internet
+  |               |--->|join                            DHT|----|--\    
+  |               |--->|loadConfig                         |    |  | Another
+  |               |--->|getValue                           |    |  | Node
+  |               |--->|storeValue                      DHT|<---|--/
+  |               |--->|leave                              |    |
+  |               |    +-----------------------------------+    |
+  |               |    +-------------+    +----------------+    |
+  |               |    | PeerManager |    | HTTPDownloader*|    |
+  |               |--->|get          |--->|get         HTTP|----|---> Mirror
+  |               |    |             |--->|getRange        |    |
+  |               |--->|close        |--->|close       HTTP|----|--\       
+  |               |    +-------------+    +----------------+    |  | Another
+  |               |    +-----------------------------------+    |  | Peer
+  |               |    |           HTTPServer          HTTP|<---|--/   
+  |               |--->|getHTTPFactory                     |    +-------------
+  |check_freshness|<---|                                   |    +-------------
+  |       get_resp|<---|                               HTTP|<---|HTTP Request
+  |               |    +-----------------------------------+    | 
+  |               |    +---------------+    +--------------+    | Local Net
+  |               |    | CacheManager  |    | ProxyFile-   |    | (apt)
+  |               |--->|scanDirectories|    | Stream*      |    |
+  |               |--->|save_file      |--->|__init__  HTTP|--->|HTTP Response
+  |               |--->|save_error     |    |              |    +-------------
+  |               |    |               |    |              |    +-------------
+  |new_cached_file|<---|               |    |          file|--->|write file
+  |               |    +---------------+    +--------------+    |
+  |               |    +---------------+    +--------------+    | Filesystem
+  |               |    | MirrorManager |    | AptPackages* |    |
+  |               |--->|updatedFile    |--->|file_updated  |    | 
+  |               |--->|findHash       |--->|findHash  file|<---|read file
+  +---------------+    +---------------+    +--------------+    +-------------
+
+"""