Documentation
¶
Index ¶
- func AddRecord(record *Record) (bool, error)
- func DeleteRecord(record *Record) (bool, error)
- func InitConfig(endpoint string, clientId string, clientSecret string, organizationName string, ...)
- func SetHttpClient(httpClient HttpClient)
- func UpdateRecord(record *Record) (bool, error)
- type AuthConfig
- type Client
- func (c *Client) AddRecord(record *Record) (bool, error)
- func (c *Client) DeleteRecord(record *Record) (bool, error)
- func (c *Client) DoGetBytes(url string) ([]byte, error)
- func (c *Client) DoGetBytesRaw(url string) ([]byte, error)
- func (c *Client) DoGetResponse(url string) (*Response, error)
- func (c *Client) DoPost(action string, queryMap map[string]string, postBytes []byte, ...) (*Response, error)
- func (c *Client) DoPostBytesRaw(url string, contentType string, body io.Reader) ([]byte, error)
- func (c *Client) GetPaginationRecords(p int, pageSize int, queryMap map[string]string) ([]*Record, int, error)
- func (c *Client) GetRecord(name string) (*Record, error)
- func (c *Client) GetRecords() ([]*Record, error)
- func (c *Client) GetUrl(action string, queryMap map[string]string) string
- func (c *Client) UpdateRecord(record *Record) (bool, error)
- type HttpClient
- type Record
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteRecord ¶
func InitConfig ¶
func SetHttpClient ¶
func SetHttpClient(httpClient HttpClient)
SetHttpClient sets custom http Client.
func UpdateRecord ¶
Types ¶
type AuthConfig ¶
type Client ¶
type Client struct {
AuthConfig
}
func NewClientWithConf ¶
func NewClientWithConf(config *AuthConfig) *Client
func (*Client) DoGetBytes ¶
DoGetBytes is a general function to get response data in bytes from param url through HTTP Get method.
func (*Client) DoGetBytesRaw ¶
DoGetBytesRaw is a general function to get response from param url through HTTP Get method.
func (*Client) DoGetResponse ¶
DoGetResponse is a general function to get response from param url through HTTP Get method.
func (*Client) DoPostBytesRaw ¶
DoPostBytesRaw is a general function to post a request from url, body through HTTP Post method.
func (*Client) GetPaginationRecords ¶
func (*Client) GetRecords ¶
type HttpClient ¶
HttpClient interface has the method required to use a type as custom http client. The net/*http.Client type satisfies this interface.
type Record ¶
type Record struct { Id int `xorm:"int notnull pk autoincr" json:"id"` Owner string `xorm:"varchar(100) index" json:"owner"` Name string `xorm:"varchar(100) index" json:"name"` CreatedTime string `xorm:"varchar(100)" json:"createdTime"` Organization string `xorm:"varchar(100)" json:"organization"` ClientIp string `xorm:"varchar(100)" json:"clientIp"` User string `xorm:"varchar(100)" json:"user"` Method string `xorm:"varchar(100)" json:"method"` RequestUri string `xorm:"varchar(1000)" json:"requestUri"` Action string `xorm:"varchar(1000)" json:"action"` Object string `xorm:"-" json:"object"` IsTriggered bool `json:"isTriggered"` }
func GetPaginationRecords ¶
func GetRecords ¶
Click to show internal directories.
Click to hide internal directories.