File: RecordHeader.pm

package info (click to toggle)
libfcgi-client-perl 0.09-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 232 kB
  • sloc: ruby: 510; perl: 408; makefile: 2
file content (62 lines) | stat: -rw-r--r-- 1,083 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package FCGI::Client::RecordHeader;
use strict;
use warnings;
use FCGI::Client::Constant;
use Types::Standard qw/Str/;

use Moo;
has raw        => ( is => 'ro', isa => Str );
no Moo;

sub content_length { unpack( 'x4n', $_[0]->raw ) }
sub padding_length { unpack( 'x6C', $_[0]->raw ) }
sub type           { unpack( 'xC',  $_[0]->raw ) }
sub request_id     { unpack( 'xxn', $_[0]->raw ) }

__PACKAGE__->meta->make_immutable;
__END__

=head1 NAME

FCGI::Client::RecordHeader - record header object for FCGI

=head1 SYNOPSIS

    my $header = FCGI::Client::RecordHeader->new(raw => $raw);
    say $header->type;

=head1 DESCRIPTION

This module is record header class for L<FCGI::Client>.

=head1 ATTRIBUTES

=over 4

=item raw

the raw string of record header.
size of record header is defined at L<FCGI::Client::Constant::FCGI_HEADER_LEN>.

=back

=head1 INSTANCE METHOD

=over 4

=item $self->request_id()

=item $self->type()

=item $self->content_length()

=item $self->padding_length()

These methods returns each field of record header.

=back

=head1 SEE ALSO

L<FCGI::Client>