At
view release on metacpan or search on metacpan
lib/At/Protocol/URI.pm view on Meta::CPAN
my $base = $uri->origin;
Returns the protocol and host.
=head2 C<host( [...] )>
my $host = $uri->host;
$uri->host('did:plc:...');
Mutator around the host.
=head2 C<pathname( [...] )>
my $path = $uri->pathname;
$uri->pathname( '/foo' );
Mutator around the url path.
=head2 C<search( [...] )>
my $search = $uri->search;
$uri->search( '?foo=bar' );
Mutator around the URI's search parameters.
=head2 C<hash( [...] )>
my $hash = $uri->hash;
$uri->hash('hash');
Mutator around the URI's hash field.
When a I<strong> reference to another record is required, best practice is to use a CID hash in addition to the AT URI.
=head2 C<collection( [...] )>
my $collection = $uri->collection;
$uri->collection( 'app.bsky.feed.post' );
Mutator around the optional collection part of the path which must be a normalized L<NSID|At::Protocol::NSID>.
=head2 C<rkey( [...] )>
my $rkey = $uri->rkey;
$uri->rkey( '3jzfcijpj2z2a' );
Mutator around the optional rkey of the path which must be a valid 'L<Record Key|https://atproto.com/specs/record-key>'
according to the AT Protocol spec.
=head2 C<ensureValidAtUri( ... )>
ensureValidAtUri( 'at://did:plc:asdf123' );
Validates an AT URI. Throws errors on failure and returns a true value on success.
=head2 C<ensureValidAtUriRegex( ... )>
ensureValidAtUriRegex( 'a://did:plc:asdf123' ); # fatal
Validates an AT URI with cursory regex provided by the AT protocol designers. Throws errors on failure and returns a
true value on success.
=head1 See Also
L<https://atproto.com/specs/at-uri-scheme>
=head1 LICENSE
Copyright (C) Sanko Robinson.
This library is free software; you can redistribute it and/or modify it under the terms found in the Artistic License
2. Other copyrights, terms, and conditions may apply to data transmitted through this module.
=head1 AUTHOR
Sanko Robinson E<lt>sanko@cpan.orgE<gt>
=begin stopwords
atproto rkey aka
=end stopwords
=cut
( run in 0.505 second using v1.01-cache-2.11-cpan-39bf76dae61 )