Documentation ¶
Index ¶
- Constants
- type ApiErr
- type Client
- func (c *Client) BulkDelete(endpoint string, payload interface{}) (*http.Response, error)
- func (c *Client) Create(endpoint string, o interface{}) (interface{}, error)
- func (c *Client) CreateWithRawPayload(endpoint string, payload string) ([]byte, error)
- func (c *Client) CreateWithSlicePayload(endpoint string, slice interface{}) ([]byte, 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) UpdateWithSlicePayload(endpoint string, slice interface{}) ([]byte, 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 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) BulkDelete ¶
BulkDelete sends an HTTP POST request for bulk deletion and expects a 204 No Content response.
func (*Client) CreateWithRawPayload ¶
CreateWithRawPayload sends an HTTP POST request with a raw string payload.
func (*Client) CreateWithSlicePayload ¶
func (*Client) GenericRequest ¶
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 ¶
func (*Client) GetSandboxURL ¶
func (*Client) UpdateWithPut ¶
Update ...
func (*Client) UpdateWithSlicePayload ¶
func (*Client) WithCacheCleanWindow ¶
func (*Client) WithCacheTtl ¶
func (*Client) WithFreshCache ¶
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 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.