|
NAMEMango::GridFS::Reader - GridFS readerSYNOPSISuse Mango::GridFS::Reader; my $reader = Mango::GridFS::Reader->new(gridfs => $gridfs); DESCRIPTIONMango::GridFS::Reader reads files from GridFS.ATTRIBUTESMango::GridFS::Reader implements the following attributes.gridfsmy $gridfs = $reader->gridfs; $reader = $reader->gridfs(Mango::GridFS->new); Mango::GridFS object this reader belongs to. METHODSMango::GridFS::Reader inherits all methods from Mojo::Base and implements the following new ones.chunk_sizemy $size = $reader->chunk_size; Chunk size in bytes. content_typemy $type = $reader->content_type; Content type of file. filenamemy $name = $reader->filename; Name of file. md5my $checksum = $reader->md5; MD5 checksum for file. metadatamy $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; readmy $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. sizemy $size = $reader->size; Size of entire file in bytes. slurpmy $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; tellmy $pos = $reader->tell; Current position. upload_datemy $time = $reader->upload_date; Date file was uploaded. SEE ALSOMango, Mojolicious::Guides, <http://mojolicio.us>.
Visit the GSP FreeBSD Man Page Interface. |