Documentation ¶
Index ¶
- func NewTLSConfig(c *Config) (*tls.Config, error)
- type Config
- type HTTPClient
- type IRESTClient
- type RESTClient
- type Request
- func (r *Request) AddHeader(key, val string) *Request
- func (r *Request) Body(data []byte) *Request
- func (r *Request) Do() Result
- func (r *Request) JSON(success interface{}, failure interface{}) error
- func (r *Request) Param(name, value string) *Request
- func (r *Request) Stream() (io.ReadCloser, error)
- func (r *Request) URL() *url.URL
- type Result
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
config holds the common attributes that can be passed to a Last.Backend client on initialization.
func (*Config) HasCertAuth ¶
HasCertAuth returns whether the configuration has certificate authentication or not.
func (*Config) HasTokenAuth ¶
HasTokenAuth returns whether the configuration has token authentication or not.
type IRESTClient ¶
type RESTClient ¶
type RESTClient struct { Client *http.Client BearerToken string // contains filtered or unexported fields }
func DefaultRESTClient ¶
func DefaultRESTClient(uri string) *RESTClient
func NewRESTClient ¶
func NewRESTClient(uri string, cfg *Config) (*RESTClient, error)
func (*RESTClient) Delete ¶
func (c *RESTClient) Delete(path string) *Request
func (*RESTClient) Get ¶
func (c *RESTClient) Get(path string) *Request
func (*RESTClient) Post ¶
func (c *RESTClient) Post(path string) *Request
func (*RESTClient) Put ¶
func (c *RESTClient) Put(path string) *Request
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (Result) StatusCode ¶
type TLSConfig ¶
type TLSConfig struct { // Server should be accessed without verifying the TLS certificate. For testing only. Insecure bool // Override for the server name passed to the server for SNI and used to verify certificates.. ServerName string // Server requires TLS client certificate authentication CertFile string // Server requires TLS client certificate authentication KeyFile string // Trusted root certificates for server CAFile string // Bytes of the PEM-encoded server trusted root certificates. Supersedes CAFile. CAData []byte // Bytes of the PEM-encoded client certificate. Supersedes CertFile. CertData []byte // Bytes of the PEM-encoded client key. Supersedes KeyFile. KeyData []byte }
TLSConfig contains settings to enable transport layer security
Click to show internal directories.
Click to hide internal directories.