Skip to content

Commit fb4be58

Browse files
committed
change readme and add license file
1 parent 92891d0 commit fb4be58

8 files changed

Lines changed: 118 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
## 1.0.0
1+
## 0.0.1
22

33
- Initial version

LICENSE

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2020, 老脸叔叔 (eclipsecycling@gmail.com)
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.BSD 3-Clause License
30+
31+
Copyright (c) 2020, 老脸叔叔 (eclipsecycling@gmail.com)
32+
All rights reserved.
33+
34+
Redistribution and use in source and binary forms, with or without
35+
modification, are permitted provided that the following conditions are met:
36+
37+
1. Redistributions of source code must retain the above copyright notice, this
38+
list of conditions and the following disclaimer.
39+
40+
2. Redistributions in binary form must reproduce the above copyright notice,
41+
this list of conditions and the following disclaimer in the documentation
42+
and/or other materials provided with the distribution.
43+
44+
3. Neither the name of the copyright holder nor the names of its
45+
contributors may be used to endorse or promote products derived from
46+
this software without specific prior written permission.
47+
48+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
49+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
51+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
52+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
54+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
55+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
56+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
57+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,56 @@
1-
under developing
1+
## About
2+
Dart library for implementing BitTorrent client.
3+
4+
## Support:
5+
- [BEP 0003 The BitTorrent Protocol Specification](http://www.bittorrent.org/beps/bep_0003.html)
6+
- [BEP 0006 Fast Extension](http://www.bittorrent.org/beps/bep_0006.html)
7+
- [BEP 0015 UDP Tracker Protocal](http://www.bittorrent.org/beps/bep_0015.html)
8+
9+
10+
Developing:
11+
12+
- [BEP 0005 DHT Protocal](http://www.bittorrent.org/beps/bep_0005.html)
13+
- [BEP 0011 Peer Exchange (PEX)](http://www.bittorrent.org/beps/bep_0011.html)
14+
15+
- [BEP 0009 Extension for Peers to Send Metadata Files](http://www.bittorrent.org/beps/bep_0009.html)
16+
- [BEP 0010 Extension Protocol](http://www.bittorrent.org/beps/bep_0010.html)
17+
18+
Other support will come soon.
19+
20+
## How to use
21+
22+
Add package dependencies: `torrent_model` and `torrent_task`:
23+
```
24+
dependencies:
25+
torrent_model : ^1.0.1
26+
torrent_task : ^0.0.1
27+
```
28+
29+
First , create a `Torrent` model via .torrent file:
30+
31+
```dart
32+
var model = await Torrent.parse('some.torrent');
33+
```
34+
35+
Second, create a `Torrent Task` and start it:
36+
```dart
37+
var task = TorrentTask.newTask(model,'savepath');
38+
task.start();
39+
```
40+
41+
User can add some listener to monitor `TorrentTask` running:
42+
```dart
43+
task.onTaskComplete(() => .....);
44+
task.onFileComplete((String filePath) => .....);
45+
```
46+
47+
and there is some method to control the `TorrentTask`:
48+
49+
```dart
50+
// Stop task:
51+
task.stop();
52+
// Pause task:
53+
task.pause();
54+
// Resume task:
55+
task.resume();
56+
```

example/torrent_task_comin_example.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'dart:async';
22

33
import 'package:torrent_model/torrent_model.dart';
4-
import 'package:torrent_task/src/torrent_task.dart';
4+
import 'package:torrent_task/src/task.dart';
55
import 'package:torrent_task/src/utils.dart';
66

77
Future<void> main() async {

lib/src/torrent_task_base.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export 'torrent_task.dart';
1+
export 'task.dart';
22
export 'utils.dart';
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/// Support for doing something awesome.
2-
///
3-
/// More dartdocs go here.
41
library torrent_task;
52

63
export 'src/torrent_task_base.dart';

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: torrent_task
2-
description: A starting point for Dart libraries or applications.
3-
version: 1.0.0
2+
description: Dart library for implement BitTorrent download client.
3+
version: 0.0.1
44
repository: https://github.com/eclipseglory/torrent_task
55
issue_tracker : https://github.com/eclipseglory/torrent_task/issues
66
publish_to: https://pub.dev/

0 commit comments

Comments
 (0)