Documentation ¶
Index ¶
- Variables
- func CreateConfigFileTemplate(fileCreationPath string) string
- type Client
- func (c *Client) Delete(url string, data io.Reader) (*http.Response, error)
- func (c *Client) Get(url string, urlParms map[string]interface{}) (*http.Response, error)
- func (c *Client) LogOff() (res *http.Response, err error)
- func (c *Client) Options() (*http.Response, error)
- func (c *Client) Post(url string, data io.Reader) (*http.Response, error)
- func (c *Client) PostForm(url string, data url.Values) (*http.Response, error)
- func (c *Client) Put(url string, data io.Reader) (*http.Response, error)
- type Credentials
Constants ¶
This section is empty.
Variables ¶
var ( // ErrParameter definitions ErrParameter = errors.New("The value entered must be of type string, int, float64, or bool") )
Functions ¶
func CreateConfigFileTemplate ¶
CreateConfigFileTemplate creates a templated json file used in NewClientFromFile. Otherwise the file format for NewClientFromFile is
{ "domain": "enter domain", "realm": "enter realm", "consumer_key": "enter key", "consumer_secrect": "enter secrect key", "email": "enter email", "password": "enter password" }
the fileCreationPath is returned incase a path is needed
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds all the auth data and wraps calls around Go's *http.Client Concurrency is left up to the user
func NewClient ¶
func NewClient(creds Credentials, debug bool) (*Client, error)
NewClient creates the basic Openx3 *Client via oauth1
func NewClientFromFile ¶
NewClientFromFile parses a JSON file to grab your Openx creds
func (*Client) Get ¶
Get is simailiar to the normal Go *http.client.Get, except string parameters can be passed in the url or the as a map[string]interface{}
func (*Client) Options ¶
Options is a wrapper for a GET request that has the /options endpoint already passed in
func (*Client) Post ¶
Post is a wrapper for the basic Go *http.client.Post, however content type is automatically set to application/json
type Credentials ¶
type Credentials struct { Domain string `json:"domain"` Realm string `json:"realm"` ConsumerKey string `json:"consumer_key"` ConsumerSecrect string `json:"consumer_secrect"` Email string `json:"email"` Password string `json:"password"` }
Credentials are to filled in order to auth into openx