Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Mango::GridFS::Reader(User Contributed Perl DocumentatMango::GridFS::Reader(3)

NAME
       Mango::GridFS::Reader - GridFS reader

SYNOPSIS
	 use Mango::GridFS::Reader;

	 my $reader = Mango::GridFS::Reader->new(gridfs	=> $gridfs);

DESCRIPTION
       Mango::GridFS::Reader reads files from GridFS.

ATTRIBUTES
       Mango::GridFS::Reader implements	the following attributes.

   gridfs
	 my $gridfs = $reader->gridfs;
	 $reader    = $reader->gridfs(Mango::GridFS->new);

       Mango::GridFS object this reader	belongs	to.

METHODS
       Mango::GridFS::Reader inherits all methods from Mojo::Base and
       implements the following	new ones.

   chunk_size
	 my $size = $reader->chunk_size;

       Chunk size in bytes.

   content_type
	 my $type = $reader->content_type;

       Content type of file.

   filename
	 my $name = $reader->filename;

       Name of file.

   md5
	 my $checksum =	$reader->md5;

       MD5 checksum for	file.

   metadata
	 my $data = $reader->metadata;

       Additional information.

   open
	 $reader = $reader->open($oid);

       Open file. You can also append a	callback to perform operation non-
       blocking.

	 $reader->open($oid => sub {
	   my ($reader,	$err) =	@_;
	   ...
	 });
	 Mojo::IOLoop->start unless Mojo::IOLoop->is_running;

   read
	 my $chunk = $reader->read;

       Read chunk. You can also	append a callback to perform operation non-
       blocking.

	 $reader->read(sub {
	   my ($reader,	$err, $chunk) =	@_;
	   ...
	 });
	 Mojo::IOLoop->start unless Mojo::IOLoop->is_running;

   seek
	 $reader = $reader->seek(13);

       Change current position.

   size
	 my $size = $reader->size;

       Size of entire file in bytes.

   slurp
	 my $data = $reader->slurp;

       Slurp all remaining data	from file. You can also	append a callback to
       perform operation non-blocking.

	 $reader->slurp(sub {
	   my ($reader,	$err, $data) = @_;
	   ...
	 });
	 Mojo::IOLoop->start unless Mojo::IOLoop->is_running;

   tell
	 my $pos = $reader->tell;

       Current position.

   upload_date
	 my $time = $reader->upload_date;

       Date file was uploaded.

SEE ALSO
       Mango, Mojolicious::Guides, <http://mojolicio.us>.

perl v5.32.0			  2018-03-17	      Mango::GridFS::Reader(3)

NAME | SYNOPSIS | DESCRIPTION | ATTRIBUTES | METHODS | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Mango::GridFS::Reader&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help