Documentation
¶
Index ¶
- type Client
- type Option
- func WithHTTPClient(httpClient *http.Client) Option
- func WithInsecureSkipVerify(insecureSkipVerify bool) Option
- func WithLogger(logger log.Logger) Option
- func WithProxy(proxy func(*http.Request) (*url.URL, error)) Option
- func WithTLSCA(ca string) Option
- func WithTLSClientCert(clientCert string) Option
- func WithTLSClientKey(clientKey string) Option
- func WithTLSServerCert(serverCert string) Option
- func WithUserAgent(userAgent string) Option
- type Response
- type ResponseRaw
- type ResponseType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents interactions with a API server
func New ¶
New lets you connect to a remote daemon over HTTPs.
A client certificate (TLSClientCert) and key (TLSClientKey) must be provided. If connecting to a daemon running in PKI mode, the PKI CA (TLSCA) must also be provided.
Unless the remote server is trusted by the system CA, the remote certificate must be provided (TLSServerCert).
func (*Client) HTTPClient ¶
HTTPClient returns the http client used for the connection. This can be used to set custom http options.
type Option ¶
type Option func(*options)
Option to be passed to Connect to customize the resulting instance.
func WithHTTPClient ¶
WithHTTPClient sets the httpClient on the option
func WithInsecureSkipVerify ¶
WithInsecureSkipVerify sets the insecureSkipVerify on the option
func WithLogger ¶
WithLogger sets the logger on the option
func WithTLSClientCert ¶
WithTLSClientCert sets the client cert on the option
func WithTLSClientKey ¶
WithTLSClientKey sets the client key on the option
func WithTLSServerCert ¶
WithTLSServerCert sets the server cert on the option
func WithUserAgent ¶
WithUserAgent sets the userAgent on the option
type Response ¶
type Response struct { Type ResponseType `json:"type" yaml:"type"` // Valid only for Sync responses Status string `json:"status" yaml:"status"` StatusCode int `json:"status_code" yaml:"status_code"` // Valid only for Async responses Operation string `json:"operation" yaml:"operation"` // Valid only for Error responses Code int `json:"error_code" yaml:"error_code"` Error string `json:"error" yaml:"error"` // Valid for Sync and Error responses Metadata json.RawMessage `json:"metadata" yaml:"metadata"` }
Response represents a operation
type ResponseRaw ¶
type ResponseRaw struct { Type ResponseType `json:"type" yaml:"type"` // Valid only for Sync responses Status string `json:"status" yaml:"status"` StatusCode int `json:"status_code" yaml:"status_code"` // Valid only for Async responses Operation string `json:"operation" yaml:"operation"` // Valid only for Error responses Code int `json:"error_code" yaml:"error_code"` Error string `json:"error" yaml:"error"` // Valid for Sync and Error responses Metadata interface{} `json:"metadata" yaml:"metadata"` }
ResponseRaw represents a operation
type ResponseType ¶
type ResponseType string
ResponseType represents a valid response type
const ( SyncResponse ResponseType = "sync" AsyncResponse ResponseType = "async" ErrorResponse ResponseType = "error" )
Response types