Movatterモバイル変換


[0]ホーム

URL:


api

package
v1.23.2Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2025 License:Apache-2.0Imports:9Imported by:1,382

Details

Repository

github.com/prometheus/client_golang

Links

Documentation

Overview

Package api provides clients for the HTTP APIs.

Index

Constants

This section is empty.

Variables

View Source
var DefaultRoundTripperhttp.RoundTripper = &http.Transport{Proxy:http.ProxyFromEnvironment,DialContext: (&net.Dialer{Timeout:   30 *time.Second,KeepAlive: 30 *time.Second,}).DialContext,TLSHandshakeTimeout: 10 *time.Second,}

DefaultRoundTripper is used if no RoundTripper is set in Config.

Functions

This section is empty.

Types

typeClient

type Client interface {URL(epstring, args map[string]string) *url.URLDo(context.Context, *http.Request) (*http.Response, []byte,error)}

Client is the interface for an API client.

funcNewClient

func NewClient(cfgConfig) (Client,error)

NewClient returns a new Client.

It is safe to use the returned Client from multiple goroutines.

typeCloseIdleradded inv1.21.0

type CloseIdler interface {CloseIdleConnections()}

typeConfig

type Config struct {// The address of the Prometheus to connect to.Addressstring// Client is used by the Client to drive HTTP requests. If not provided,// a new one based on the provided RoundTripper (or DefaultRoundTripper) will be used.Client *http.Client// RoundTripper is used by the Client to drive HTTP requests. If not// provided, DefaultRoundTripper will be used.RoundTripperhttp.RoundTripper}

Config defines configuration parameters for a new client.

Source Files

View all Source files

Directories

PathSynopsis
prometheus
v1
Package v1 provides bindings to the Prometheus HTTP API v1: http://prometheus.io/docs/querying/api/
Package v1 provides bindings to the Prometheus HTTP API v1: http://prometheus.io/docs/querying/api/

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp