Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrParse is returned when we are unable to parse a phone number // into the proper format. In this case, it's advised to show an // error message to the user and ask them to check their input. ErrParse = fmt.Errorf("sendblue: failed to parse phone number") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
A Client is used to send API requests to Sendblue.
func NewCustomClient ¶
NewCustomClient creates a new client from a key pair and a custom client.
func NewDefaultClient ¶
NewDefaultClient creates a new client from a key pair, using the default http.Client implementation.
type Message ¶
A Message is sent or received from Sendblue.
func ReadWebhook ¶
func ReadWebhook(r io.ReadCloser) (*Message, error)
ReadWebhook is a method used to process an incoming webhook from Sendblue.
type MessageResponse ¶
type MessageResponse struct {
Status string `json:"status"`
ErrorCode string `json:"error_code"`
FromNumber string `json:"from_number"`
MessageHandle string `json:"message_handle"`
}
A MessageResponse is returned from Sendblue after a message request was sent. This is used to check for any errors.
Click to show internal directories.
Click to hide internal directories.