Documentation ¶
Index ¶
Constants ¶
const ( ContentMD5 string = "Content-MD5" Authorization string = "Authorization" Date string = "Date" ContentType string = "Content-Type" ApplicationJSON string = "application/json" AuthenticatePath string = "affiliates/authenticate" BodyString string = "" Method string = "POST" APIAuthPrefix string = "APIAuth" )
ContentMD5 - Content MD5 header key. Authorization - Authorization header key. Date - Date header key. ContentType - Content Type header key. ApplicationJSON - application/JSON string value. AuthenticatePath - Path to the authentication signature endpoint. BodyString - Authentication request body. Method - HTTP Method to use at Authentication (POST).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client - Interface to connect with Kueski Affiliates API.
func NewClient ¶
NewClient - Constructor for Kueski API Client. url - API host URL. apiKey - API key. secretKey - Service secret key.
func (*Client) AuthorizationToken ¶
AuthorizationToken - Creates a signature for API authentication.
func (*Client) Evaluate ¶
Evaluate - Performs the lead evaluation. curp - Lead CURP. email - Lead email. fullData - Struct with the full lead data to be sent to Kueski API. Returns: A string with the Request ID if the operation was successful, otherwise error will not be nil. -- Steps to follow: * Request a JWT. * Call LeadEvaluation with CURP and email. * Identify if response is successful, otherwise return proper error code. * Request a JWT. * Call LeadData with fullData and Request ID. * Identify if response is successful, otherwise return proper error code. * Return Request ID if all successful.
func (*Client) RequestToken ¶
RequestToken - Internal function to retrieve a valid JWT from Kueski API
type JWTProvider ¶
JWTProvider - Structure that handles the JWT requests.
func (*JWTProvider) Token ¶
func (jwt *JWTProvider) Token(client TokenAccessor) (string, error)
Token - Provides a valid JSON web Token.
type TokenAccessor ¶
TokenAccessor - Interface that defines the API auth methods.
type TokenProvider ¶
type TokenProvider interface {
Token(client TokenAccessor) (string, error)
}
TokenProvider - Interface that defines the Token retrieval signature.