Documentation ¶
Index ¶
- Constants
- type CvpClient
- func (c *CvpClient) Connect(username string, password string) error
- func (c *CvpClient) Get(url string, params *url.Values) ([]byte, error)
- func (c *CvpClient) GetSessionID() string
- func (c *CvpClient) Post(url string, params *url.Values, data interface{}) ([]byte, error)
- func (c *CvpClient) SetConnectTimeout(timeout int) error
- func (c *CvpClient) SetDebug(enable bool) error
- func (c *CvpClient) SetHosts(host ...string) error
- func (c *CvpClient) SetOption(options ...Option) error
- func (c *CvpClient) SetPort(port int) error
- func (c *CvpClient) SetProtocol(proto string) error
- type HostIterator
- type Option
Constants ¶
const NumRetryRequests = 3
NumRetryRequests specifies the number for retries to attempt
const UNDEFPORT = -1
UNDEFPORT undefined port
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CvpClient ¶
type CvpClient struct { cvpapi.ClientInterface Hosts []string HostPool *HostIterator Port int Protocol string Timeout time.Duration Client *resty.Client Headers map[string]string SessID string API *cvpapi.CvpRestAPI Debug bool // contains filtered or unexported fields }
CvpClient represents a CVP client api connection
func NewCvpClient ¶
NewCvpClient creates a new CVP RESTful Client
func (*CvpClient) GetSessionID ¶
GetSessionID returns the current Session ID
func (*CvpClient) SetConnectTimeout ¶
SetConnectTimeout sets the connection timeout associated with this connection
func (*CvpClient) SetProtocol ¶
SetProtocol sets the protocol (i.e. http or https) associated with this connection
type HostIterator ¶
type HostIterator struct {
// contains filtered or unexported fields
}
HostIterator implements an itorator for a list of hostnames/ips
func NewHostIterator ¶
func NewHostIterator(hosts []string) (*HostIterator, error)
NewHostIterator inits an itorator for host list
func (*HostIterator) Cycle ¶
func (h *HostIterator) Cycle() string
Cycle returns the next host in the list. If we've exceeded the length of the list, then circle back to the first.
func (*HostIterator) Next ¶
func (h *HostIterator) Next() bool
Next returns true if there is another element to iterate. False if we reach the end of the list
func (*HostIterator) Value ¶
func (h *HostIterator) Value() string
Value returns the value for the current entry