Documentation
¶
Index ¶
Constants ¶
View Source
const ( URLApi = "/api/" URLAccessToken = "auth/token" )
View Source
const ( ErrorInternal = "internal" // Connector error ErrorNetwork = "network" // Network error ErrorInvalidResponse = "invalid_response" // Server response cannot be decoded )
ResponseError.ID
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector struct {
Debug bool
// contains filtered or unexported fields
}
Connector object
func NewConnector ¶
func NewConnector(host, clientID, clientSecret string, persistor TokensPersistor) *Connector
NewConnector make a new Dyn Connector
func (*Connector) Send ¶
func (c *Connector) Send(operation string, dataSend, dataReceive interface{}) *ResponseError
Send operation request, passing data and receiving custom data types
func (*Connector) SetDebug ¶
func (c *Connector) SetDebug(enableDebug bool, customHTTPheader map[string]string, protocolByHost bool)
SetDebug enable or disable debug and internal params
func (*Connector) SetUserAgent ¶
SetUserAgent optionally sets the User-Agent header for future requests.
type ResponseError ¶
type ResponseError struct {
ID string `json:"error"`
Reason string `json:"error_description"`
HTTPCode int
}
ResponseError with error codes
func (*ResponseError) Error ¶
func (err *ResponseError) Error() string
type TokensPersistor ¶
TokensPersistor mantains the tokens persistent
Click to show internal directories.
Click to hide internal directories.