Documentation ¶
Index ¶
- Constants
- Variables
- func GetBoolFromMaybeValue(rawVal interface{}) (bool, error)
- func IsUnknownValueMatch(rawVal interface{}) bool
- func Output(content OutputFormat, formatType string) (string, error)
- type ApiError
- type ApiParams
- type AvParams
- type Client
- func (client *Client) AdultVerify(ctx context.Context, avParams *AvParams) (*SuccessAvResponse, error)
- func (client *Client) AvSolo(ctx context.Context, avParams *AvParams) (*SuccessAvSoloResponse, error)
- func (client *Client) ChargeSms(ctx context.Context, smsParams *SmsParams) (*SuccessChargeResponse, error)
- func (client *Client) KycSolo(ctx context.Context, kycParams *KycSoloParams) (*KycSoloResponseWrapper, error)
- func (client *Client) OperatorLookup(ctx context.Context, oplkParams *OperatorLookupParams) (*SuccessOperatorLookupResponse, error)
- func (client *Client) SendBinSms(ctx context.Context, smsParams *SmsBinParams) (*SuccessResponse, error)
- func (client *Client) SendSms(ctx context.Context, smsParams *SmsParams) (*SuccessResponse, error)
- func (client *Client) SendWapPush(ctx context.Context, smsParams *SmsWapParams) (*SuccessWapResponse, error)
- func (c *Client) SetBaseAvSoloURL(baseAvSoloURL string) *Client
- func (c *Client) SetBaseKycSoloURL(baseKycSoloURL string) *Client
- func (c *Client) SetBaseURL(baseURL string) *Client
- func (c *Client) SetHttpClient(httpClient *http.Client) *Client
- type KycSoloParams
- type KycSoloResponseWrapper
- type OperatorLookupParams
- type OutputFormat
- type SmsBinParams
- type SmsParams
- type SmsWapParams
- type SuccessAvResponse
- type SuccessAvResponseWrapper
- type SuccessAvSoloResponse
- type SuccessAvSoloResponseWrapper
- type SuccessChargeResponse
- type SuccessChargeResponseWrapper
- type SuccessKycSoloResponse
- type SuccessOperatorLookupResponse
- type SuccessOperatorLookupResponseWrapper
- type SuccessResponse
- type SuccessResponseWrapper
- type SuccessWapResponse
- type SuccessWapResponseWrapper
Constants ¶
View Source
const ( AV_VERIFIED = "verified" AV_NOT_VERIFIED = "no_verified" AV_UNKNOWN = "unknown" AV_PENDING = "pending" )
View Source
const ( DEFAULT_URL = "https://sonar.fonix.io" DEFAULT_URL_AVSOLO = "https://avsolo.fonix.io" DEFAULT_URL_KYCSOLO = "https://kycsolo.fonix.io" V2_SENDSMS = "v2/sendsms" V2_SENDSMSBIN = "v2/sendbinsms" V2_CHARGESMS = "v2/chargesms" V2_SENDWAPPUSH = "v2/sendwappush" V2_ADULTVERIFY = "v2/adultverify" V2_OPERATORLOOKUP = "v2/operator_lookup" V2_AVSOLO = "v2/avsolo" V2_KYCSOLO = "v2/kyc" )
Variables ¶
View Source
var ( //default timeout for requests is 15 seconds, can be changed by using custom http client // or you can change it via this VAr before creation of client. CLIENT_TIMEOUT = 15 * time.Second )
View Source
var (
ErrUnknownValue = errors.New("unknown value")
)
Functions ¶
func GetBoolFromMaybeValue ¶ added in v0.0.4
func IsUnknownValueMatch ¶ added in v0.0.4
func IsUnknownValueMatch(rawVal interface{}) bool
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AdultVerify ¶
func (*Client) KycSolo ¶ added in v0.0.4
func (client *Client) KycSolo(ctx context.Context, kycParams *KycSoloParams) (*KycSoloResponseWrapper, error)
func (*Client) OperatorLookup ¶
func (client *Client) OperatorLookup(ctx context.Context, oplkParams *OperatorLookupParams) (*SuccessOperatorLookupResponse, error)
func (*Client) SendBinSms ¶
func (client *Client) SendBinSms(ctx context.Context, smsParams *SmsBinParams) (*SuccessResponse, error)
func (*Client) SendWapPush ¶
func (client *Client) SendWapPush(ctx context.Context, smsParams *SmsWapParams) (*SuccessWapResponse, error)
func (*Client) SetBaseAvSoloURL ¶ added in v0.0.3
func (*Client) SetBaseKycSoloURL ¶ added in v0.0.4
type KycSoloParams ¶ added in v0.0.4
type KycSoloParams struct { Name string Surname string Number string HouseNumber string PostCode string DOB string RequestID string Dummy string }
func (*KycSoloParams) ToParams ¶ added in v0.0.4
func (kycParams *KycSoloParams) ToParams() string
type KycSoloResponseWrapper ¶ added in v0.0.4
type KycSoloResponseWrapper struct { CompletedData *SuccessKycSoloResponse `json:"completed"` PendingData *errorResponseContent `json:"pending"` }
type OperatorLookupParams ¶
func (*OperatorLookupParams) ToParams ¶
func (oplkParams *OperatorLookupParams) ToParams() string
type OutputFormat ¶ added in v0.0.5
type OutputFormat interface { //ToConsole(color bool) string ToConsole() string }
type SmsBinParams ¶
func (*SmsBinParams) ToParams ¶
func (smsParams *SmsBinParams) ToParams() string
type SmsWapParams ¶
type SmsWapParams struct { Originator string Numbers string PushTitle string PushLink string Dummy string }
func (*SmsWapParams) ToParams ¶
func (smsParams *SmsWapParams) ToParams() string
type SuccessAvResponse ¶
func (*SuccessAvResponse) ToConsole ¶ added in v0.0.5
func (sr *SuccessAvResponse) ToConsole() string
type SuccessAvResponseWrapper ¶
type SuccessAvResponseWrapper struct {
SuccessData SuccessAvResponse `json:"success"`
}
type SuccessAvSoloResponse ¶
type SuccessAvSoloResponse struct { Status string IfVersion string `json:"ifversion"` Operator string `json:"operator"` Guid string `json:"guid"` }
func (*SuccessAvSoloResponse) ToConsole ¶ added in v0.0.5
func (sr *SuccessAvSoloResponse) ToConsole() string
type SuccessAvSoloResponseWrapper ¶
type SuccessAvSoloResponseWrapper struct { VerifiedData *SuccessAvSoloResponse `json:"verified"` NotVerifiedData *SuccessAvSoloResponse `json:"not_verified"` UnknownData *SuccessAvSoloResponse `json:"unknown"` PendingData *SuccessAvSoloResponse `json:"pending"` }
type SuccessChargeResponse ¶
type SuccessChargeResponse struct { TxGuid string `json:"txguid"` Numbers string `json:"numbers"` Price string `json:"price"` Encoding string `json:"encoding"` }
func (*SuccessChargeResponse) ToConsole ¶ added in v0.0.5
func (sr *SuccessChargeResponse) ToConsole() string
type SuccessChargeResponseWrapper ¶
type SuccessChargeResponseWrapper struct {
SuccessData SuccessChargeResponse `json:"success"`
}
type SuccessKycSoloResponse ¶ added in v0.0.4
type SuccessKycSoloResponse struct { Guid string `json:"guid"` IfVersion string `json:"ifversion"` StatusCode string `json:"statuscode"` StatusText string `json:"statustext"` RequestID string `json:"requestid"` StatusTime string `json:"status_time"` FirstNameMatch interface{} `json:"first_name_match"` // match fields and is_Stole are weird string or bool types LastNameMatch interface{} `json:"last_name_match"` // this means end client needs to do a cast and see FullNameMatch interface{} `json:"full_name_match"` PostCodeMatch interface{} `json:"postcode_match"` HouseMatch interface{} `json:"house_match"` FullAddressMatch interface{} `json:"full_address_match"` BirthdayMatch interface{} `json:"birthday_match"` IsStolen interface{} `json:"is_stolen"` ContractType string `json:"contract_type"` }
type SuccessOperatorLookupResponse ¶
type SuccessOperatorLookupResponse struct { Mnc string `json:"mnc"` Mcc string `json:"mcc"` Operator string `json:"operator"` }
func (*SuccessOperatorLookupResponse) ToConsole ¶ added in v0.0.5
func (sr *SuccessOperatorLookupResponse) ToConsole() string
type SuccessOperatorLookupResponseWrapper ¶
type SuccessOperatorLookupResponseWrapper struct {
SuccessData SuccessOperatorLookupResponse `json:"success"`
}
type SuccessResponse ¶
type SuccessResponse struct { TxGuid string `json:"txguid"` Numbers string `json:"numbers"` SmsParts string `json:"smsparts"` Encoding string `json:"encoding"` }
func (*SuccessResponse) ToConsole ¶ added in v0.0.5
func (sr *SuccessResponse) ToConsole() string
type SuccessResponseWrapper ¶
type SuccessResponseWrapper struct {
SuccessData SuccessResponse `json:"success"`
}
type SuccessWapResponse ¶
type SuccessWapResponse struct { TxGuid string `json:"txguid"` Numbers string `json:"numbers"` SmsParts string `json:"smsparts"` }
func (*SuccessWapResponse) ToConsole ¶ added in v0.0.5
func (sr *SuccessWapResponse) ToConsole() string
type SuccessWapResponseWrapper ¶
type SuccessWapResponseWrapper struct {
SuccessData SuccessWapResponse `json:"success"`
}
Click to show internal directories.
Click to hide internal directories.