Documentation
¶
Overview ¶
Package f5 provides a client for using the F5 API.
Index ¶
- func IsRequestError(err error) bool
- type Client
- func (c *Client) DisableCertCheck()
- func (c Client) Do(req *http.Request) (*http.Response, error)
- func (c Client) MakeRequest(method, restPath string, data interface{}) (*http.Request, error)
- func (c Client) ModQuery(method, restPath string, inputData interface{}) error
- func (c Client) ReadError(resp *http.Response) error
- func (c Client) ReadQuery(restPath string, outputData interface{}) error
- func (c Client) SendRequest(method, restPath string, data interface{}) (*http.Response, error)
- type RequestError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRequestError ¶
IsRequestError reports whether err is a RequestError.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client manages communication with the F5 API.
func NewBasicClient ¶
NewBasicClient creates a new F5 client with HTTP Basic Authentication.
baseURL is the base URL of the F5 API server.
func NewTokenClient ¶
NewTokenClient creates a new F5 client with token based authentication.
baseURL is the base URL of the F5 API server.
func (*Client) DisableCertCheck ¶
func (c *Client) DisableCertCheck()
DisableCertCheck disables certificate verification, meaning that insecure certificate will not cause any error.
func (Client) Do ¶
Do sends an HTTP request and returns an HTTP response. It is just a wrapper arround http.Client Do method.
Callers should close resp.Body when done reading from it.
See http package documentation for more information:
https://golang.org/pkg/net/http/#Client.Do
func (Client) MakeRequest ¶
MakeRequest creates a request with headers appropriately set to make authenticated requests. This method must be called for every new request.
type RequestError ¶
type RequestError struct { Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` ErrStack []string `json:"errorStack,omitempty"` }
A RequestError is returned as a HTTP Response by the F5 Big IP server in case of error.
func NewRequestError ¶
func NewRequestError(body io.Reader) (*RequestError, error)
NewRequestError unmarshal a RequestError from a HTTP response body.
func (RequestError) Error ¶
func (err RequestError) Error() string
Error implements the errors.Error interface
func (RequestError) String ¶
func (err RequestError) String() string