Documentation ¶
Index ¶
- Constants
- type ApiErr
- type Client
- func (c *Client) Create(endpoint string, o interface{}) (interface{}, error)
- func (c *Client) Delete(endpoint string) error
- func (c *Client) GenericRequest(baseUrl, endpoint, method string, body io.Reader, urlParams url.Values, ...) ([]byte, error)
- func (c *Client) GetContentType() string
- func (c *Client) GetSandboxToken() string
- func (c *Client) GetSandboxURL() string
- func (c *Client) Logout() error
- func (c *Client) Read(endpoint string, o interface{}) error
- func (c *Client) Request(endpoint, method string, data []byte, contentType string) ([]byte, error)
- func (c *Client) Update(endpoint string, o interface{}) (interface{}, error)
- func (c *Client) UpdateWithPut(endpoint string, o interface{}) (interface{}, error)
- func (c *Client) WithCache(cache bool)
- func (c *Client) WithCacheCleanWindow(i time.Duration)
- func (c *Client) WithCacheTtl(i time.Duration)
- func (client *Client) WithFreshCache()
- type Credentials
- type ErrorResponse
- type Session
Constants ¶
View Source
const ( JSessionIDTimeout = 30 // minutes. MaxNumOfRetries = 100 RetryWaitMaxSeconds = 20 RetryWaitMinSeconds = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { sync.Mutex URL string HTTPClient *http.Client Logger logger.Logger UserAgent string // contains filtered or unexported fields }
Client ... Client ...
func (*Client) GenericRequest ¶ added in v2.2.0
func (c *Client) GenericRequest(baseUrl, endpoint, method string, body io.Reader, urlParams url.Values, contentType string) ([]byte, error)
Request ... // Needs to review this function.
func (*Client) GetContentType ¶
func (*Client) GetSandboxToken ¶ added in v2.2.0
func (*Client) GetSandboxURL ¶ added in v2.2.0
func (*Client) UpdateWithPut ¶
Update ...
func (*Client) WithCacheCleanWindow ¶ added in v2.1.0
func (*Client) WithCacheTtl ¶ added in v2.1.0
func (*Client) WithFreshCache ¶ added in v2.1.0
func (client *Client) WithFreshCache()
type Credentials ¶
type Credentials struct { Username string `json:"username"` Password string `json:"password"` APIKey string `json:"apiKey"` TimeStamp string `json:"timestamp"` }
Credentials ...
type ErrorResponse ¶
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
func (ErrorResponse) IsObjectNotFound ¶
func (r ErrorResponse) IsObjectNotFound() bool
IsObjectNotFound returns true on missing object error (404).
type Session ¶
type Session struct { AuthType string `json:"authType"` ObfuscateAPIKey bool `json:"obfuscateApiKey"` PasswordExpiryTime int `json:"passwordExpiryTime"` PasswordExpiryDays int `json:"passwordExpiryDays"` Source string `json:"source"` JSessionID string `json:"jSessionID,omitempty"` }
Session ...
func MakeAuthRequestZIA ¶
func MakeAuthRequestZIA(credentials *Credentials, url string, client *http.Client, userAgent string) (*Session, error)
MakeAuthRequestZIA authenticates using the provided credentials and returns the session or an error.
Click to show internal directories.
Click to hide internal directories.