Documentation ¶
Overview ¶
Package rest implements a REST client for communicating with remote services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
Client implements an HTTP/REST client for communicating with remote services.
func (Client) WithBytes ¶
WithBytes returns a shallow copy of the client with the bytes set as the message body to include in the requests.
func (Client) WithHeader ¶
WithHeader returns a shallow copy of the client with a header to include the requests.
type Config ¶
type Config struct { Name string `json:"name"` URL string `json:"url"` Headers map[string]string `json:"headers"` AllowInsureTLS bool `json:"allow_insecure_tls,omitempty"` Credentials struct { Bearer *struct { Scheme string `json:"scheme,omitempty"` Token string `json:"token"` } `json:"bearer,omitempty"` ClientTLS *struct { Cert string `json:"cert"` PrivateKey string `json:"private_key"` PrivateKeyPassphrase string `json:"private_key_passphrase,omitempty"` } `json:"client_tls,omitempty"` } `json:"credentials"` }
Config represents configuration for a REST client.
Click to show internal directories.
Click to hide internal directories.