/
config.go
95 lines (80 loc) · 3.5 KB
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package config
import (
"github.com/pulumi/pulumi-github/sdk/v6/go/github/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
var _ = internal.GetEnvOrDefault
// The GitHub App credentials used to connect to GitHub. Conflicts with `token`. Anonymous mode is enabled if both `token`
// and `appAuth` are not set.
func GetAppAuth(ctx *pulumi.Context) string {
return config.Get(ctx, "github:appAuth")
}
// The GitHub Base API URL
func GetBaseUrl(ctx *pulumi.Context) string {
v, err := config.Try(ctx, "github:baseUrl")
if err == nil {
return v
}
var value string
if d := internal.GetEnvOrDefault("https://api.github.com/", nil, "GITHUB_BASE_URL"); d != nil {
value = d.(string)
}
return value
}
// Enable `insecure` mode for testing purposes
func GetInsecure(ctx *pulumi.Context) bool {
return config.GetBool(ctx, "github:insecure")
}
// Number of times to retry a request after receiving an error status codeDefaults to 3
func GetMaxRetries(ctx *pulumi.Context) int {
return config.GetInt(ctx, "github:maxRetries")
}
// The GitHub organization name to manage. Use this field instead of `owner` when managing organization accounts.
//
// Deprecated: Use owner (or GITHUB_OWNER) instead of organization (or GITHUB_ORGANIZATION)
func GetOrganization(ctx *pulumi.Context) string {
return config.Get(ctx, "github:organization")
}
// The GitHub owner name to manage. Use this field instead of `organization` when managing individual accounts.
func GetOwner(ctx *pulumi.Context) string {
return config.Get(ctx, "github:owner")
}
// Allow the provider to make parallel API calls to GitHub. You may want to set it to true when you have a private Github
// Enterprise without strict rate limits. Although, it is not possible to enable this setting on github.com because we
// enforce the respect of github.com's best practices to avoid hitting abuse rate limitsDefaults to false if not set
func GetParallelRequests(ctx *pulumi.Context) bool {
return config.GetBool(ctx, "github:parallelRequests")
}
// Amount of time in milliseconds to sleep in between non-write requests to GitHub API. Defaults to 0ms if not set.
func GetReadDelayMs(ctx *pulumi.Context) int {
return config.GetInt(ctx, "github:readDelayMs")
}
// Amount of time in milliseconds to sleep in between requests to GitHub API after an error response. Defaults to 1000ms or
// 1s if not set, the maxRetries must be set to greater than zero.
func GetRetryDelayMs(ctx *pulumi.Context) int {
return config.GetInt(ctx, "github:retryDelayMs")
}
// Allow the provider to retry after receiving an error status code, the maxRetries should be set for this to workDefaults
// to [500, 502, 503, 504]
func GetRetryableErrors(ctx *pulumi.Context) string {
return config.Get(ctx, "github:retryableErrors")
}
// The OAuth token used to connect to GitHub. Anonymous mode is enabled if both `token` and `appAuth` are not set.
func GetToken(ctx *pulumi.Context) string {
v, err := config.Try(ctx, "github:token")
if err == nil {
return v
}
var value string
if d := internal.GetEnvOrDefault(nil, nil, "GITHUB_TOKEN"); d != nil {
value = d.(string)
}
return value
}
// Amount of time in milliseconds to sleep in between writes to GitHub API. Defaults to 1000ms or 1s if not set.
func GetWriteDelayMs(ctx *pulumi.Context) int {
return config.GetInt(ctx, "github:writeDelayMs")
}