telesign

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageTypeARN = "ARN"
	MessageTypeOTP = "OTP" // one-time password
)

Variables

This section is empty.

Functions

func SendMessage

func SendMessage(ctx context.Context, key, secret string, msg Message) error

Types

type Client

type Client struct {
	Key    string
	Secret string
}

func NewClient

func NewClient(key, secret string) *Client

func (*Client) SendMessage

func (c *Client) SendMessage(ctx context.Context, msg Message) error

type Message

type Message struct {
	Phone   string `json:"phone,omitempty" valid:"required"`
	Content string `json:"content,omitempty" valid:"required"`
	Type    string `json:"type,omitempty" valid:"in(ARN|OTP)"` // default is OTP
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL