github.com/kaisenlinux/docker.io@v0.0.0-20230510090727-ea55db55fac7/engine/client/client_deprecated.go (about) 1 package client 2 3 import "net/http" 4 5 // NewClient initializes a new API client for the given host and API version. 6 // It uses the given http client as transport. 7 // It also initializes the custom http headers to add to each request. 8 // 9 // It won't send any version information if the version number is empty. It is 10 // highly recommended that you set a version or your client may break if the 11 // server is upgraded. 12 // Deprecated: use NewClientWithOpts 13 func NewClient(host string, version string, client *http.Client, httpHeaders map[string]string) (*Client, error) { 14 return NewClientWithOpts(WithHost(host), WithVersion(version), WithHTTPClient(client), WithHTTPHeaders(httpHeaders)) 15 } 16 17 // NewEnvClient initializes a new API client based on environment variables. 18 // See FromEnv for a list of support environment variables. 19 // 20 // Deprecated: use NewClientWithOpts(FromEnv) 21 func NewEnvClient() (*Client, error) { 22 return NewClientWithOpts(FromEnv) 23 }