1GitLab::API::v4::ConfigU(s3eprm)Contributed Perl DocumenGtiattLiaobn::API::v4::Config(3pm)
2
3
4

NAME

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

SYNOPSIS

10           use GitLab::API::v4;
11           use GitLab::API::v4::Config;
12
13           my $config = GitLab::API::v4::Config->new();
14           my $api = GitLab::API::v4->new( $config->args() );
15

DESCRIPTION

17       This module is used by gitlab-api-v4 to load configuration.
18
19       If you are using GitLab::API::v4 directly then this module will not be
20       automatically used, but you are welcome to explicitly use it as shown
21       in the "SYNOPSIS".
22

ARGUMENTS

24   file
25       The file to load configuration from.  The file should hold valid JSON.
26
27       By default this will be set to ".gitlab-api-v4-config" in the current
28       user's home directory.
29
30       This can be overridden with the "GITLAB_API_V4_CONFIG_FILE" environment
31       variable or the "--config-file=..." command line argument.
32

ATTRIBUTES

34   opt_args
35       Returns a hashref of arguments derived from command line options.
36
37       Supported options are:
38
39           --config_file=...
40           --url=...
41           --private-token=...
42           --access-token=...
43           --retries=...
44
45       Note that the options are read from, and removed from, @ARGV.  Due to
46       this the arguments are saved internally and re-used for all instances
47       of this class so that there are no weird race conditions.
48
49   env_args
50       Returns a hashref of arguments derived from environment variables.
51
52       Supported environment variables are:
53
54           GITLAB_API_V4_CONFIG_FILE
55           GITLAB_API_V4_URL
56           GITLAB_API_V4_PRIVATE_TOKEN
57           GITLAB_API_V4_ACCESS_TOKEN
58           GITLAB_API_V4_RETRIES
59
60   file_args
61       Returns a hashref of arguments gotten by decoding the JSON in the
62       "file".
63
64   args
65       Returns a final, combined, hashref of arguments containing everything
66       in "opt_args", "env_args", and "file_args".  If there are any duplicate
67       arguments then "opt_args" has highest precedence, "env_args" is next,
68       and at the bottom is "file_args".
69

METHODS

71   get_options
72   configure
73       When called this method interactively prompts the user for argument
74       values and then encodes them as JSON and stores them in "file".  The
75       file will be chmod'ed 0600 so that only the current user may read or
76       write to the file.
77

SUPPORT

79       See "SUPPORT" in GitLab::API::v4.
80

AUTHORS

82       See "AUTHORS" in GitLab::API::v4.
83

LICENSE

85       See "LICENSE" in GitLab::API::v4.
86
87
88
89perl v5.36.1                      2023-06-08      GitLab::API::v4::Config(3pm)
Impressum