Documentation ¶
Index ¶
- func IsEmptyValue(v reflect.Value) bool
- func MakeHTTPRequest(url string, credentials types.Credentials, method types.Action, ...) (status int, resp []byte, err error)
- func StructToMap(tag string, structs ...interface{}) (m map[string]interface{}, err error)
- type Exorequester
- func (p *Exorequester) DELETE(url string) *Exorequester
- func (p *Exorequester) Debug(debug bool) *Exorequester
- func (p *Exorequester) Do() (status int, response []byte, err error)
- func (p *Exorequester) GET(url string) *Exorequester
- func (p *Exorequester) Log(vals ...interface{})
- func (p *Exorequester) POST(url string) *Exorequester
- func (p *Exorequester) PUT(url string) *Exorequester
- func (p *Exorequester) Params(requestData interface{}) *Exorequester
- func (p *Exorequester) SetAuth(username string, password string) *Exorequester
- func (p *Exorequester) SetHeaders() *Exorequester
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsEmptyValue ¶
IsEmptyValue checks if the reflect.Value given is empty or not
func MakeHTTPRequest ¶
func MakeHTTPRequest(url string, credentials types.Credentials, method types.Action, data interface{}, debug bool) (status int, resp []byte, err error)
MakeHTTPRequest makes a request to exotel platform api for desire operation
func StructToMap ¶
StructToMap converts one or more struct to a map of string to interface Its uses the tag 'tag' to check the name to be used ,if the second struct had the same tag name the second one will be overriding the first if the value is nil or no tag is defined no key is added
Types ¶
type Exorequester ¶
type Exorequester struct { LastError error // contains filtered or unexported fields }
Exorequester makes actual requests to the p.URL
func NewExorequester ¶
func NewExorequester() *Exorequester
NewExorequester creates a new instance of Exorequester
func (*Exorequester) DELETE ¶
func (p *Exorequester) DELETE(url string) *Exorequester
DELETE Makes Delete request to the end point
func (*Exorequester) Debug ¶
func (p *Exorequester) Debug(debug bool) *Exorequester
Debug set the client in debug mode
func (*Exorequester) Do ¶
func (p *Exorequester) Do() (status int, response []byte, err error)
Do does the execution of request
func (*Exorequester) GET ¶
func (p *Exorequester) GET(url string) *Exorequester
GET Makes get request to the end point
func (*Exorequester) Log ¶
func (p *Exorequester) Log(vals ...interface{})
Log writes log for the Client
func (*Exorequester) POST ¶
func (p *Exorequester) POST(url string) *Exorequester
POST Makes post request to the end point
func (*Exorequester) PUT ¶
func (p *Exorequester) PUT(url string) *Exorequester
PUT Makes put request to the end point
func (*Exorequester) Params ¶
func (p *Exorequester) Params(requestData interface{}) *Exorequester
Params sets the parameters for requestss
func (*Exorequester) SetAuth ¶
func (p *Exorequester) SetAuth(username string, password string) *Exorequester
SetAuth sets basic auth
func (*Exorequester) SetHeaders ¶
func (p *Exorequester) SetHeaders() *Exorequester
SetHeaders Sets needed headers