| 1 | # Licensed to Elasticsearch B.V under one or more agreements. | ||
| 2 | # Elasticsearch B.V licenses this file to you under the Apache 2.0 License. | ||
| 3 | # See the LICENSE file in the project root for more information | ||
| 4 | |||
| 5 | package Search::Elasticsearch::Role::Client; | ||
| 6 | 55 | $Search::Elasticsearch::Role::Client::VERSION = '8.12'; | |
| 7 | 55 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 55 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 55 | requires 'parse_request'; | |
| 11 | |||
| 12 | 55 | has 'transport' => ( is => 'ro', required => 1 ); | |
| 13 | 55 | has 'logger' => ( is => 'ro', required => 1 ); | |
| 14 | |||
| 15 | #=================================== | ||
| 16 | 0 | ▶ | sub perform_request { |
|
Subroutine
perform_request: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 17 | #=================================== | ||
| 18 | 0 | my $self = shift; | |
| 19 | 0 | my $request = $self->parse_request(@_); | |
| 20 | 0 | return $self->transport->perform_request($request); | |
| 21 | } | ||
| 22 | |||
| 23 | 55 | 1; | |
| 24 | |||
| 25 | =pod | ||
| 26 | |||
| 27 | =encoding UTF-8 | ||
| 28 | |||
| 29 | =head1 NAME | ||
| 30 | |||
| 31 | Search::Elasticsearch::Role::Client - Provides common functionality for Client implementations | ||
| 32 | |||
| 33 | =head1 VERSION | ||
| 34 | |||
| 35 | version 8.12 | ||
| 36 | |||
| 37 | =head1 DESCRIPTION | ||
| 38 | |||
| 39 | This role provides a common C<perform_request()> method for Client | ||
| 40 | implementations. | ||
| 41 | |||
| 42 | =head1 METHODS | ||
| 43 | |||
| 44 | =head2 C<perform_request()> | ||
| 45 | |||
| 46 | This method takes whatever arguments it is passed and passes them directly to | ||
| 47 | a C<parse_request()> method (which should be provided by Client implementations). | ||
| 48 | The C<parse_request()> method should return a request suitable for passing | ||
| 49 | to L<Search::Elasticsearch::Transport/perform_request()>. | ||
| 50 | |||
| 51 | =head1 AUTHOR | ||
| 52 | |||
| 53 | Enrico Zimuel <enrico.zimuel@elastic.co> | ||
| 54 | |||
| 55 | =head1 COPYRIGHT AND LICENSE | ||
| 56 | |||
| 57 | This software is Copyright (c) 2024 by Elasticsearch BV. | ||
| 58 | |||
| 59 | This is free software, licensed under: | ||
| 60 | |||
| 61 | The Apache License, Version 2.0, January 2004 | ||
| 62 | |||
| 63 | =cut | ||
| 64 | |||
| 65 | __END__ | ||