api
package v1.23.2
Go to latest Published: Sep 5, 2025 License:Apache-2.0
Opens a new window with list of versions in this module.
Latest LatestThis package is not in the latest version of its module.
Opens a new window with license information.
Imports:9 Opens a new window with list of imports.
Imported by:1,382 Opens a new window with list of known importers.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
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.
typeCloseIdler¶added 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.
Click to show internal directories.
Click to hide internal directories.