Documentation
¶
Index ¶
Constants ¶
const ( // EnvStandard is the standard env EnvStandard = "Standard" // EnvEnterprise is the enterprise env EnvEnterprise = "Enterprise" // MessageARN type MessageARN = "ARN" // MessageMKT type MessageMKT = "MKT" // MessageOTP type MessageOTP = "OTP" // UcidAtck For use in a 2FA situation like updating an account, or trying to log in. UcidAtck = "ATCK" // UcidBacf For creating an account on somebody's service in a situation where the service may be vulnerable to bulk attacks or individual fraudsters. UcidBacf = "BACF" // UcidBacs For creating an account on somebody's service in a situation where the service may be vulnerable to bulk attacks or individual spammers. UcidBacs = "BACS" // UcidChbk For use in a situation such as someone trying to buy something expensive or unusual on your platform, and you want to verify that it is really them. UcidChbk = "CHBK" // UcidCldr Calendar Event UcidCldr = "CLDR" // UcidLead For use in a situation where you require a person to enter their personal information in order to obtain information about something like a loan or realty or a school, and you want to check if the person is bogus or not. UcidLead = "LEAD" // UcidOthr For use in a 2FA situation like updating an account, or trying to log in. UcidOthr = "OTHR" // UcidPwrt For use in a situation where a password reset is required. UcidPwrt = "PWRT" // UcidResv For use in a situation where you have end users making reservations and not showing up, and you want to be able to include some kind of phone verification in that loop. UcidResv = "RESV" // UcidRxpf For use in situations where you are trying to prevent prescription fraud. UcidRxpf = "RXPF" // UcidShip For use in situations where you are sending a shipping notification. UcidShip = "SHIP" // UcidThef For use in situations where you are trying to prevent an end user from deactivating or redirecting a phone number in order to take over someone else's identity. UcidThef = "THEF" // UcidTrvf For use in situations where you are transferring money, and you want to check to see if it is approved by sending a text message or phone call to your end user. This is similar to CHBK, but is specifically for a money transaction. UcidTrvf = "TRVF" // UcidUnkn is the same as OTHR. UcidUnkn = "UNKN" // PhoneTypeFixedLineCode number PhoneTypeFixedLineCode = "1" // PhoneTypeFixedLine name PhoneTypeFixedLine = "FIXED_LINE" // PhoneTypeMobileCode number PhoneTypeMobileCode = "2" // PhoneTypeMobile name PhoneTypeMobile = "MOBILE" // PhoneTypePrepaidCode number PhoneTypePrepaidCode = "3" // PhoneTypePrepaid name PhoneTypePrepaid = "PREPAID" // PhoneTypeTollFreeCode number PhoneTypeTollFreeCode = "4" // PhoneTypeTollFree name PhoneTypeTollFree = "TOLL_FREE" // PhoneTypeVoipCode number PhoneTypeVoipCode = "5" // PhoneTypeVoip name PhoneTypeVoip = "VOIP" // PhoneTypePagerCode number PhoneTypePagerCode = "6" // PhoneTypePager name PhoneTypePager = "PAGER" // PhoneTypePayphoneCode number PhoneTypePayphoneCode = "7" // PhoneTypePayphone name PhoneTypePayphone = "PAYPHONE" // PhoneTypeInvalidCode number PhoneTypeInvalidCode = "8" // PhoneTypeInvalid name PhoneTypeInvalid = "INVALID" // PhoneTypeRestrictedPremiumCode number PhoneTypeRestrictedPremiumCode = "9" // PhoneTypeRestrictedPremium name PhoneTypeRestrictedPremium = "RESTRICTED_PREMIUM" // PhoneTypePersonalCode number PhoneTypePersonalCode = "10" // PhoneTypePersonal name PhoneTypePersonal = "PERSONAL" // PhoneTypeVoicemailCode number PhoneTypeVoicemailCode = "11" // PhoneTypeVoicemail name PhoneTypeVoicemail = "VOICEMAIL" // PhoneTypeOtherCode number PhoneTypeOtherCode = "12" // PhoneTypeOther name PhoneTypeOther = "OTHER" // CallForwardActionBlock name CallForwardActionBlock = "block" // AccountLifecycleEventCreate name AccountLifecycleEventCreate = "create" // Active name Active = "ACTIVE" // Valid name Valid = "VALID" // Reachable name Reachable = "REACHABLE" Unavailable = "UNAVAILABLE" )
Variables ¶
This section is empty.
Functions ¶
func StructToURLValues ¶
StructToURLValues convert struct data to URL Values
Types ¶
type AdditionalInfo ¶ added in v1.0.4
type AdditionalInfo struct { CodeEntered string `json:"code_entered"` MessagePartsCount int `json:"message_parts_count"` }
AdditionalInfo returned by telesign API
type Connection ¶
type Connection interface { SetEnv(env string) SetCustomerID(id string) SetAPIKey(key string) SetHTTPTimeout(i int) Execute(req Request) (Response, error) }
Connection interface
func NewPhoneID ¶
func NewPhoneID(options ...OptConFunc) Connection
NewPhoneID return a new PhoneID connection
func NewScore ¶
func NewScore(options ...OptConFunc) Connection
NewScore return a new Score connection
func NewStatus ¶ added in v1.0.4
func NewStatus(options ...OptConFunc) Connection
NewStatus return a new Status connection
func NewVoice ¶
func NewVoice(options ...OptConFunc) Connection
NewVoice return a new Voice connection
type MainResponse ¶
type MainResponse struct { StatusCode int ResourceURI string `json:"resource_uri"` ReferenceID string `json:"reference_id"` Status StatusResponse `json:"status"` }
MainResponse returned by telesign API
func (MainResponse) Failure ¶
func (r MainResponse) Failure() bool
Failure return true if failure, otherwise false
func (MainResponse) GetStatusCode ¶
func (r MainResponse) GetStatusCode() int
GetStatusCode return response HTTP status code
func (MainResponse) Message ¶
func (r MainResponse) Message() string
Message return status description
type OptConFunc ¶
type OptConFunc func(Connection) error
OptConFunc is a function that configures a Connection
func SetConCustomerID ¶
func SetConCustomerID(id string) OptConFunc
SetConCustomerID set the customer ID
type PhoneID ¶
type PhoneID struct {
// contains filtered or unexported fields
}
PhoneID object
func (*PhoneID) SetCustomerID ¶
SetCustomerID set the current customer ID
func (*PhoneID) SetHTTPTimeout ¶
SetHTTPTimeout set the current HTTP request timeout
type Request ¶
type Request interface { GetMethod() string GetURI() string GetPath() string GetBody() string ParseResponse(statusCode int, content []byte) (Response, error) }
Request interface
type SMS ¶
type SMS struct {
// contains filtered or unexported fields
}
SMS object
func (*SMS) SetCustomerID ¶
SetCustomerID set the current customer ID
func (*SMS) SetHTTPTimeout ¶
SetHTTPTimeout set the current HTTP request timeout
type Score ¶
type Score struct {
// contains filtered or unexported fields
}
Score object
func (*Score) SetCustomerID ¶
SetCustomerID set the current customer ID
func (*Score) SetHTTPTimeout ¶
SetHTTPTimeout set the current HTTP request timeout
type Status ¶ added in v1.0.4
type Status struct {
// contains filtered or unexported fields
}
Status object
func (*Status) SetCustomerID ¶ added in v1.0.4
SetCustomerID set the current customer ID
func (*Status) SetHTTPTimeout ¶ added in v1.0.4
SetHTTPTimeout set the current HTTP request timeout
type StatusResponse ¶
type StatusResponse struct { Code int `json:"code"` UpdatedOn string `json:"updated_on"` Description string `json:"description"` }
StatusResponse returned by telesign API
type Telesign ¶
type Telesign struct {
// contains filtered or unexported fields
}
Telesign object
func (*Telesign) PhoneID ¶
func (t *Telesign) PhoneID(options ...OptConFunc) Connection
PhoneID return PhoneID service
func (*Telesign) SMS ¶
func (t *Telesign) SMS(options ...OptConFunc) Connection
SMS return SMS service
func (*Telesign) Score ¶
func (t *Telesign) Score(options ...OptConFunc) Connection
Score return Score service
func (*Telesign) Status ¶ added in v1.0.5
func (t *Telesign) Status(options ...OptConFunc) Connection
Status return Status service
func (*Telesign) Voice ¶
func (t *Telesign) Voice(options ...OptConFunc) Connection
Voice return Voice service
type Voice ¶
type Voice struct {
// contains filtered or unexported fields
}
Voice object
func (*Voice) SetCustomerID ¶
SetCustomerID set the current customer ID
func (*Voice) SetHTTPTimeout ¶
SetHTTPTimeout set the current HTTP request timeout