Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

GitLab::API::v4::Config

Name GitLab::API::v4::Config
Version 0.26
Located at /usr/share/perl5
File /usr/share/perl5/GitLab/API/v4/Config.pm
Is Core No
Search CPAN for this module GitLab::API::v4::Config
Documentation GitLab::API::v4::Config
Module Details GitLab::API::v4::Config


NAME

GitLab::API::v4::Config - Load configuration from a file, environment, and/or CLI options.


SYNOPSIS

    use GitLab::API::v4;
    use GitLab::API::v4::Config;

    my $config = GitLab::API::v4::Config->new();
    my $api = GitLab::API::v4->new( $config->args() );


DESCRIPTION

This module is used by gitlab-api-v4 to load configuration.

If you are using the GitLab::API::v4 manpage directly then this module will not be automatically used, but you are welcome to explicitly use it as shown in the SYNOPSIS.


ARGUMENTS

file

The file to load configuration from. The file should hold valid JSON.

By default this will be set to .gitlab-api-v4-config in the current user's home directory.

This can be overridden with the GITLAB_API_V4_CONFIG_FILE environment variable or the --config-file=... command line argument.


ATTRIBUTES

opt_args

Returns a hashref of arguments derived from command line options.

Supported options are:

    --config_file=...
    --url=...
    --private-token=...
    --access-token=...
    --retries=...

Note that the options are read from, and removed from, @ARGV. Due to this the arguments are saved internally and re-used for all instances of this class so that there are no weird race conditions.

env_args

Returns a hashref of arguments derived from environment variables.

Supported environment variables are:

    GITLAB_API_V4_CONFIG_FILE
    GITLAB_API_V4_URL
    GITLAB_API_V4_PRIVATE_TOKEN
    GITLAB_API_V4_ACCESS_TOKEN
    GITLAB_API_V4_RETRIES

file_args

Returns a hashref of arguments gotten by decoding the JSON in the file.

args

Returns a final, combined, hashref of arguments containing everything in opt_args, env_args, and file_args. If there are any duplicate arguments then opt_args has highest precedence, env_args is next, and at the bottom is file_args.


METHODS

get_options

configure

When called this method interactively prompts the user for argument values and then encodes them as JSON and stores them in file. The file will be chmod'ed 0600 so that only the current user may read or write to the file.


SUPPORT

See SUPPORT in the GitLab::API::v4 manpage.


AUTHORS

See AUTHORS in the GitLab::API::v4 manpage.


COPYRIGHT AND LICENSE

See COPYRIGHT AND LICENSE in the GitLab::API::v4 manpage.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026