Various documentation fixes and additions.
[quix0rs-apt-p2p.git] / apt_dht / __init__.py
1
2 """The main apt-dht modules.
3
4 To run apt-dht, you probably want to do something like::
5
6   from apt_dht.apt_dht import AptDHT
7   myapp = AptDHT(myDHT)
8
9 where myDHT is a DHT that implements interfaces.IDHT.
10
11 Diagram of the interaction between the given modules::
12   
13   +---------------+    +-----------------------------------+    +-------------
14   |     AptDHT    |    |               DHT                 |    |  Internet
15   |               |--->|join                            DHT|----|--\    
16   |               |--->|loadConfig                         |    |  | Another
17   |               |--->|getValue                           |    |  | Node
18   |               |--->|storeValue                      DHT|<---|--/
19   |               |--->|leave                              |    |
20   |               |    +-----------------------------------+    |
21   |               |    +-------------+    +----------------+    |
22   |               |    | PeerManager |    | HTTPDownloader*|    |
23   |               |--->|get          |--->|get         HTTP|----|---> Mirror
24   |               |    |             |--->|getRange        |    |
25   |               |--->|close        |--->|close       HTTP|----|--\       
26   |               |    +-------------+    +----------------+    |  | Another
27   |               |    +-----------------------------------+    |  | Peer
28   |               |    |           HTTPServer          HTTP|<---|--/   
29   |               |--->|getHTTPFactory                     |    +-------------
30   |check_freshness|<---|                                   |    +-------------
31   |       get_resp|<---|                               HTTP|<---|HTTP Request
32   |               |    +-----------------------------------+    | 
33   |               |    +---------------+    +--------------+    | Local Net
34   |               |    | CacheManager  |    | ProxyFile-   |    | (apt)
35   |               |--->|scanDirectories|    | Stream*      |    |
36   |               |--->|save_file      |--->|__init__  HTTP|--->|HTTP Response
37   |               |--->|save_error     |    |              |    +-------------
38   |               |    |               |    |              |    +-------------
39   |new_cached_file|<---|               |    |          file|--->|write file
40   |               |    +---------------+    +--------------+    |
41   |               |    +---------------+    +--------------+    | Filesystem
42   |               |    | MirrorManager |    | AptPackages* |    |
43   |               |--->|updatedFile    |--->|file_updated  |    | 
44   |               |--->|findHash       |--->|findHash  file|<---|read file
45   +---------------+    +---------------+    +--------------+    +-------------
46
47 """