%s
Calls the RPC method
%son the service. Takes a hash of parameters representing the request.EOF } $methods_pod .= "=back\n\n";
# Generate full gRPC service client wrapper $client_code = sprintf(<<'EOF', $module_name, $bridge_code, $use_statements, $grpc_target, $methods_code, $module_name, $module_name, $module_name, $module_name, $methods_pod); package %s;use strict; use warnings; use Moo; use Google::gRPC::Client; use Google::Cloud::REST::Client; use Google::Auth; use Carp qw(croak); %s %s
our $VERSION = '0.01';
has credentials => ( is => 'ro', required => 0 ); has transport => ( is => 'rw' );
sub BUILD { my ($self) = @_;
# Resolve credentials: use passed credentials object if it implements get_token, or default to ADC my $auth = $self->credentials; if (!$auth || !eval { $auth->can('get_token') }) { $auth = Google::Auth->default(); } my $token = $auth->get_token(); my $target = '%s'; my $t = $self->transport || 'grpc'; if (ref($t) && eval { $t->can('call') }) { # Already a transport object } elsif (lc($t) eq 'rest') { my $client = Google::Cloud::REST::Client->new( target => $target, auth_token => $token, ); $self->transport($client); } else { # Default high-performance HTTP/2 gRPC client my $client = Google::gRPC::Client->new( target => $target, auth_token => $token, ); $self->transport($client); } } %s1; # End of %s__END__
NAME
%s - Auto-generated client library for Google Cloud Services
SYNOPSIS
use %s;
use Google::Auth;
my $auth = Google::Auth->new(...);
my $client = %s->new(
credentials => $auth
);
DESCRIPTION
This is an auto-generated Protocol Buffers client library for Google Cloud Services, built on top of high-performance gRPC and Protocol Buffers!
%s=head1 LICENSE
Apache License 2.0
NAME
%s - Auto-generated Protocol Buffers schema container
DESCRIPTION
This is an auto-generated Protocol Buffers schema container module for Google Cloud Services.
LICENSE
Apache License 2.0
NAME
Module::Starter::Protobuf - A Module::Starter plugin for generating Protocol Buffers client libraries
VERSION
Version 0.01
SYNOPSIS
use Module::Starter qw(Module::Starter::Protobuf);
# Or from the command line:
# PROTOBUF_FILES=protos/my_service.proto module-starter --module=My::Client --plugin=Module::Starter::Protobuf
DESCRIPTION
This is a Module::Starter plugin that automates the generation of skeletal CPAN distributions from Protocol Buffers (proto3) schemas. It runs the protoc compiler to generate low-level serialization classes using the upb C/XS compiler plugin and automatically generates high-level client wrappers with idiomatic gRPC call methods.
METHODS
create_distro
Intercepts and validates the protobuf configuration parameters from arguments or environment variables.
create_modules
Generates the low-level protobuf serialization classes and the high-level client wrapper modules.
create_t
Generates the dynamic service integration tests (t/01-service.t) under the target directory.
Makefile_PL_guts
Injects the required dependencies (Moo, Net::Curl, Google::Auth, Google::gRPC::Client, Protobuf) into the generated Makefile.PL.
AUTHOR
C.J. Collier <cjac@google.com>
LICENSE AND COPYRIGHT
This software is Copyright (c) 2026 by C.J. Collier <cjac@google.com>.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 245:
'=item' outside of any '=over'
- Around line 306:
You forgot a '=back' before '=head1'