From 103a9c5a2f0c95e52cc2c249efc4852117d31d85 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 11 Jan 2012 23:34:20 +0100 Subject: [PATCH] document API --- gearman/transmission.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gearman/transmission.pl b/gearman/transmission.pl index dc30efe..1d7d729 100755 --- a/gearman/transmission.pl +++ b/gearman/transmission.pl @@ -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; -- 2.20.1