document API
[cloudstore.git] / gearman / transmission.pl
index dc30efe..1d7d729 100755 (executable)
@@ -30,6 +30,12 @@ my $name = $ENV{ZSLICE} || die "need ZSLICE";
 my $torrent_dir = "/$name/torrent";
 $name =~ s/\W+/_/g;
 
+=head1 host_s1_torrent_list
+
+Returns JSON encoded list of all torrents
+
+=cut
+
 $worker->register_function( $name . '_torrent_list' => sub {
        my ($job) = @_;
        my @cols = split(/\s+/,$job->arg);
@@ -45,6 +51,12 @@ $worker->register_function( $name . '_torrent_list' => sub {
        return $j->encode( \@list );
 } );
 
+=head1 host_s1_torrent_download ~login/path.torrent
+
+Start download of torrent
+
+=cut
+
 $worker->register_function( $name . '_torrent_download' => sub {
        my $work = $_[0]->arg;
        chomp $work;
@@ -105,6 +117,12 @@ $worker->register_function( $name . '_torrent_download_done' => sub {
 
 } );
 
+=head1 host_s1_torrent_share ~login/file.txt
+
+Create torrent and start seeding it
+
+=cut
+
 $worker->register_function( $name . '_torrent_share' => sub {
        my $work = $_[0]->arg;
        chomp $work;