Mango:...:Reader(3pm)
π Mango::GridFS::Reader β the GridFS reader bestie π
okay so welcome to Mango::GridFS::Reader, a page from the User Contributed Perl Documentation, filed under Mango:...:Reader(3pm). she reads files. from GridFS. that's the whole vibe and honestly? iconic.
β¨ NAME β¨
Mango::GridFS::Reader β GridFS reader π¦
β¨ SYNOPSIS β¨
use Mango::GridFS::Reader;
my $reader = Mango::GridFS::Reader->new(gridfs => $gridfs);
like. that's it. that's the whole summoning ritual. no cap. π
β¨ DESCRIPTION β¨
Mango::GridFS::Reader reads files from GridFS. that's the assignment, and she ate. π₯
β¨ ATTRIBUTES β¨
Mango::GridFS::Reader implements the following attributes. yes bestie, we're doing all of them, no skipping. π
β¨ gridfs β¨
my $gridfs = $reader->gridfs;
$reader = $reader->gridfs(Mango::GridFS->new);
the Mango::GridFS object this reader belongs to. it's giving main character's origin story. πΈ
β¨ METHODS β¨
Mango::GridFS::Reader inherits all methods from Mojo::Base and implements the following new ones. (so everything Mojo::Base gave her? still there. we don't disown family. π«Ά)
β¨ chunk_size β¨
my $size = $reader->chunk_size;
chunk size, in bytes. π
β¨ content_type β¨
my $type = $reader->content_type;
content type of file. slay. π
β¨ filename β¨
my $name = $reader->filename;
name of file. yes she knows her own name, she's not having an identity crisis. πͺ
β¨ md5 β¨
my $checksum = $reader->md5;
MD5 checksum for file. the fingerprint. the receipts. π§Ύ
β¨ metadata β¨
my $data = $reader->metadata;
additional information. the lore. π
β¨ open β¨
$reader = $reader->open($oid);
open file. and bestie β you can also append a callback to perform the operation non-blocking. multitasking queen behavior. π
$reader->open($oid => sub {
my ($reader, $err) = @_;
...
});
Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
β¨ read β¨
my $chunk = $reader->read;
read chunk. yep, you can also append a callback here to perform the operation non-blocking. same energy, different method. π₯
$reader->read(sub {
my ($reader, $err, $chunk) = @_;
...
});
Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
β¨ seek β¨
$reader = $reader->seek(13);
change current position. glow-up, but for your file pointer. β¨
β¨ size β¨
my $size = $reader->size;
size of entire file, in bytes. the full scope. the whole picture. π
β¨ slurp β¨
my $data = $reader->slurp;
slurp all remaining data from file. all of it. no crumbs left. π and yes, you can also append a callback to perform the 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. where are we? she'll tell you. π
β¨ upload_date β¨
my $time = $reader->upload_date;
date file was uploaded. the anniversary. the throwback. ποΈ
β¨ SEE ALSO β¨
Mango, Mojolicious::Guides, <http://mojolicio.us>. go read those too, bestie, they're the supporting cast. π
and that's the page!! π this whole thing comes from perl v5.30.3, dated 2020-06-05, and it lives in the User Contributed Perl Documentation section as Mango:...:Reader(3pm). mwah. periodt. π
πβ¨
π¦ where this page comes from
- debian bookworm: libmango-perl 1.30-2 Β· Artistic-2.0
- debian trixie: libmango-perl 1.30-2 Β· Artistic-2.0
- ubuntu jammy: libmango-perl 1.30-2 Β· Artistic-2.0
- ubuntu noble: libmango-perl 1.30-2 Β· Artistic-2.0
- ubuntu resolute: libmango-perl 1.30-2 Β· Artistic-2.0
- ubuntu stonking: libmango-perl 1.30-2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms