Documentation
¶
Index ¶
- Constants
- type Client
- type EnvironmentType
- func (e EnvironmentType) CreateMiscallVerifyUrl() string
- func (e EnvironmentType) CreateMiscalllUrl() string
- func (e EnvironmentType) CreateSmsOtpURL() string
- func (e EnvironmentType) CreateSmsOtpVerifyURL() string
- func (e EnvironmentType) CreateWhatsappOtpURL() string
- func (e EnvironmentType) CreateWhatsappOtpVerifyURL() string
- func (e EnvironmentType) String() string
- type FlexInt
- type SmsGateway
- func (gateway *SmsGateway) RequestMiscallOtp(req *VerihubsMisscallOtpRequest) (response *VerihubsMisscallOtpResponse, err error)
- func (gateway *SmsGateway) RequestMiscallVerifyOtp(req *VerihubsOtpVerifyRequest) (response *VerihubsOtpVerifyResponse, err error)
- func (gateway *SmsGateway) SendSmsOtp(req *VerihubsSmsOtpRequest) (response *VerihubsSmsOtpResponse, err error)
- func (gateway *SmsGateway) SendWhatsAppOtp(req *VerihubsWhatsappOtpRequest) (response *VerihubsWhatsappOtpResponse, err error)
- func (gateway *SmsGateway) VerifyOtp(req *VerihubsOtpVerifyRequest) (response *VerihubsOtpVerifyResponse, err error)
- func (gateway *SmsGateway) VerifySmsOtp(req *VerihubsOtpVerifyRequest) (response *VerihubsOtpVerifyResponse, err error)
- type VerihubsMisscallOtpRequest
- type VerihubsMisscallOtpResponse
- type VerihubsOtpVerifyRequest
- type VerihubsOtpVerifyResponse
- type VerihubsSmsOtpRequest
- type VerihubsSmsOtpResponse
- type VerihubsWhatsappOtpRequest
- type VerihubsWhatsappOtpResponse
Constants ¶
const ( VerihubsSuccess = 200 VerihubsSuccessRequest = 201 VerihubsBadRequest = 400 VerihubsForbidden = 403 VerihubsConflict = 409 VerihubsTooManyReq = 429 VerihubsInternalError = 500 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
APIEnvType EnvironmentType
AppId string
AppKey string
LogLevel int
}
Client struct
func NewClient ¶
func NewClient() Client
NewClient : this function will always be called when the library is in use
func (*Client) ExecuteRequest ¶
ExecuteRequest : execute request
type EnvironmentType ¶
type EnvironmentType int8
EnvironmentType value
const ( // Sandbox : represent sandbox environment Sandbox EnvironmentType // Production : represent production environment Production )
func (EnvironmentType) CreateMiscallVerifyUrl ¶
func (e EnvironmentType) CreateMiscallVerifyUrl() string
CreateMisscallVerifyURL : Create Misscall verify URL
func (EnvironmentType) CreateMiscalllUrl ¶
func (e EnvironmentType) CreateMiscalllUrl() string
CreateMisscallURL : Create Misscall URL
func (EnvironmentType) CreateSmsOtpURL ¶
func (e EnvironmentType) CreateSmsOtpURL() string
CreateSmsOtpURL : Create SMSOTP URL
func (EnvironmentType) CreateSmsOtpVerifyURL ¶
func (e EnvironmentType) CreateSmsOtpVerifyURL() string
CreateSmsOtpVerifyURL : Create VERIFY URL
func (EnvironmentType) CreateWhatsappOtpURL ¶
func (e EnvironmentType) CreateWhatsappOtpURL() string
CreateWhatsappOtpURL : Create SMSOTP URL
func (EnvironmentType) CreateWhatsappOtpVerifyURL ¶
func (e EnvironmentType) CreateWhatsappOtpVerifyURL() string
CreateWhatsappOtpVerifyURL : Create VERIFY URL
type FlexInt ¶
type FlexInt int
A FlexInt is an int that can be unmarshalled from a JSON field that has either a number or a string value. E.g. if the json field contains an string "42", the FlexInt value will be "42".
func (*FlexInt) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface, which allows us to ingest values of any json type as an int and run our custom conversion
type SmsGateway ¶
type SmsGateway struct {
Client Client
}
SmsGateway struct
func (*SmsGateway) RequestMiscallOtp ¶
func (gateway *SmsGateway) RequestMiscallOtp(req *VerihubsMisscallOtpRequest) (response *VerihubsMisscallOtpResponse, err error)
RequestMiscallOtp request miscall for OTP
func (*SmsGateway) RequestMiscallVerifyOtp ¶
func (gateway *SmsGateway) RequestMiscallVerifyOtp(req *VerihubsOtpVerifyRequest) (response *VerihubsOtpVerifyResponse, err error)
RequestMiscallOtp request miscall for OTP
func (*SmsGateway) SendSmsOtp ¶
func (gateway *SmsGateway) SendSmsOtp(req *VerihubsSmsOtpRequest) (response *VerihubsSmsOtpResponse, err error)
SendSmsOtp send sms for OTP
func (*SmsGateway) SendWhatsAppOtp ¶
func (gateway *SmsGateway) SendWhatsAppOtp(req *VerihubsWhatsappOtpRequest) (response *VerihubsWhatsappOtpResponse, err error)
func (*SmsGateway) VerifyOtp ¶
func (gateway *SmsGateway) VerifyOtp(req *VerihubsOtpVerifyRequest) (response *VerihubsOtpVerifyResponse, err error)
VerifySmsOtp Verify SMS OTP
func (*SmsGateway) VerifySmsOtp ¶
func (gateway *SmsGateway) VerifySmsOtp(req *VerihubsOtpVerifyRequest) (response *VerihubsOtpVerifyResponse, err error)
VerifySmsOtp Verify SMS OTP
type VerihubsMisscallOtpRequest ¶
type VerihubsMisscallOtpRequest struct {
MSISDN string `json:"msisdn"`
OTP string `json:"otp"`
TimeLimit string `json:"time_limit"`
Challenge string `json:"challenge"`
}
VerihubsMiscallOtpRequest Verihubs misscallOTP Request
type VerihubsMisscallOtpResponse ¶
type VerihubsMisscallOtpResponse struct {
Data struct {
SessionId string `json:"id"`
Status int `json:"status"`
FlashCall string `json:"flashcall_prefix"`
}
Code int `json:"code"`
Message string `json:"message"`
ErrorStatus bool `json:"-"`
}
VerihubsSmsOtpResponse Verihubs SMSOTP Response
func (VerihubsMisscallOtpResponse) Error ¶
func (e VerihubsMisscallOtpResponse) Error() string
type VerihubsOtpVerifyRequest ¶
type VerihubsOtpVerifyRequest struct {
OTP string `json:"otp"`
MSISDN string `json:"msisdn"`
Challenge string `json:"challenge"`
}
VerifySmsOtpVerihubs
type VerihubsOtpVerifyResponse ¶
type VerihubsOtpVerifyResponse struct {
Code int `json:"code"`
Message string `json:"message"`
ErrorStatus bool `json:"-"`
}
VerihubsSmsOtpVerifyResponse Verihubs SMSOTP Verify Response
func (VerihubsOtpVerifyResponse) Error ¶
func (e VerihubsOtpVerifyResponse) Error() string
type VerihubsSmsOtpRequest ¶
type VerihubsSmsOtpRequest struct {
MSISDN string `json:"msisdn"`
Template string `json:"template"`
OTP string `json:"otp"`
TimeLimit string `json:"time_limit"`
Challenge string `json:"challenge"`
}
VerihubsSmsOtpRequest Verihubs SMSOTP Request
type VerihubsSmsOtpResponse ¶
type VerihubsSmsOtpResponse struct {
Code int `json:"code"`
Message string `json:"message"`
OTP string `json:"otp"`
MSISDN string `json:"msisdn"`
SessionId string `json:"session_id"`
TryCount int `json:"try_count"`
SegmentCount int `json:"segment_count"`
ErrorStatus bool `json:"-"`
}
VerihubsSmsOtpResponse Verihubs SMSOTP Response
func (VerihubsSmsOtpResponse) Error ¶
func (e VerihubsSmsOtpResponse) Error() string
type VerihubsWhatsappOtpRequest ¶
type VerihubsWhatsappOtpRequest struct {
MSISDN string `json:"msisdn"`
//Content []string `json:"content"`
OTP string `json:"otp"`
TimeLimit string `json:"time_limit"`
Challenge string `json:"challenge"`
LangCode string `json:"lang_code"`
TemplateName string `json:"template_name"`
}
VerihubsWhatsappOtpRequest Verihubs SMSOTP Request
type VerihubsWhatsappOtpResponse ¶
type VerihubsWhatsappOtpResponse struct {
Code int `json:"code"`
Message string `json:"message"`
OTP string `json:"otp"`
MSISDN string `json:"msisdn"`
SessionId string `json:"session_id"`
TryCount int `json:"try_count"`
ErrorStatus bool `json:"-"`
}
VerihubsWhatsappOtpResponse Verihubs WhatsappOTP Response
func (VerihubsWhatsappOtpResponse) Error ¶
func (e VerihubsWhatsappOtpResponse) Error() string