Documentation
¶
Index ¶
- func NewGitHubAPIRateLimitLimit() *prometheus.GaugeVec
- func NewGitHubAPIRateLimitRemaining() *prometheus.GaugeVec
- func NewGitHubAPIRateLimitReset() *prometheus.GaugeVec
- func NewGitHubAPIRateLimitUsed() *prometheus.GaugeVec
- func NewGitHubAPIRequestDuration() *prometheus.HistogramVec
- func NewGitHubAPIRequestTotal() *prometheus.CounterVec
- func NewGitHubMetricsClient(metricsContext *MetricsContext) *http.Client
- func NewGitHubMetricsClientFrom(httpClient *http.Client, metricsContext *MetricsContext) *http.Client
- func SetupBitbucketClient(ctx context.Context, config *bitbucketv1.Configuration, scmRootCAPath string, ...) *bitbucketv1.APIClient
- type GitHubMetrics
- type GitHubMetricsTransport
- type MetricsContext
- type Repos
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGitHubAPIRateLimitLimit ¶
func NewGitHubAPIRateLimitLimit() *prometheus.GaugeVec
func NewGitHubAPIRateLimitRemaining ¶
func NewGitHubAPIRateLimitRemaining() *prometheus.GaugeVec
func NewGitHubAPIRateLimitReset ¶
func NewGitHubAPIRateLimitReset() *prometheus.GaugeVec
func NewGitHubAPIRateLimitUsed ¶
func NewGitHubAPIRateLimitUsed() *prometheus.GaugeVec
func NewGitHubAPIRequestDuration ¶
func NewGitHubAPIRequestDuration() *prometheus.HistogramVec
func NewGitHubAPIRequestTotal ¶
func NewGitHubAPIRequestTotal() *prometheus.CounterVec
Factory functions for each metric vector
func NewGitHubMetricsClient ¶
func NewGitHubMetricsClient(metricsContext *MetricsContext) *http.Client
NewGitHubMetricsClient wraps an http.Client with metrics middleware
func NewGitHubMetricsClientFrom ¶
func NewGitHubMetricsClientFrom(httpClient *http.Client, metricsContext *MetricsContext) *http.Client
NewGitHubMetricsClientFrom returns a new http.Client wrapping the provided one with metrics middleware
func SetupBitbucketClient ¶
func SetupBitbucketClient(ctx context.Context, config *bitbucketv1.Configuration, scmRootCAPath string, insecure bool, caCerts []byte, proxyURL, noProxy string) *bitbucketv1.APIClient
SetupBitbucketClient configures and creates a Bitbucket API client with TLS settings
Types ¶
type GitHubMetrics ¶
type GitHubMetrics struct {
RequestTotal *prometheus.CounterVec
RequestDuration *prometheus.HistogramVec
RateLimitRemaining *prometheus.GaugeVec
RateLimitLimit *prometheus.GaugeVec
RateLimitReset *prometheus.GaugeVec
RateLimitUsed *prometheus.GaugeVec
}
GitHubMetrics groups all metric vectors for easier injection and registration
func NewGitHubMetrics ¶
func NewGitHubMetrics() *GitHubMetrics
Factory for a new set of GitHub metrics (for tests or custom registries)
type GitHubMetricsTransport ¶
type GitHubMetricsTransport struct {
// contains filtered or unexported fields
}
GitHubMetricsTransport is a custom http.RoundTripper that collects GitHub API metrics
func NewDefaultGitHubMetricsTransport ¶
func NewDefaultGitHubMetricsTransport(transport http.RoundTripper, metricsContext *MetricsContext) *GitHubMetricsTransport
Default constructor
func NewGitHubMetricsTransport ¶
func NewGitHubMetricsTransport( transport http.RoundTripper, metricsContext *MetricsContext, metrics *GitHubMetrics, ) *GitHubMetricsTransport
Full constructor (for tests and advanced use)
type MetricsContext ¶
type Repos ¶
type Repos interface {
// GetFiles returns content of files (not directories) within the target repo
GetFiles(ctx context.Context, repoURL, revision, project, pattern string, noRevisionCache bool, sourceIntegrity *v1alpha1.SourceIntegrity) (map[string][]byte, error)
// GetDirectories returns a list of directories (not files) within the target repo
GetDirectories(ctx context.Context, repoURL, revision, project string, noRevisionCache bool, sourceIntegrity *v1alpha1.SourceIntegrity) ([]string, error)
}
Click to show internal directories.
Click to hide internal directories.