twiliogae

package module
v0.0.0-...-67f50a8 Latest Latest
Warning

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

Go to latest
Published: May 22, 2015 License: MIT Imports: 13 Imported by: 0

README

twilio-gae

Update GAE libraries

An unofficial Go helper library for Twilio that works with Google App Engine (using urlfetch transport over the standard net/http package).

This package is an adaptation of the twiliogo package (a much more complete package for working with twilio services) that has been stripped out and left only with the capability to send SMS messages, while replacing the use of the net/http package with Google's appengine/urlfetch package (the only way to perform post/get requests from within the gae sandbox)

usage

license

MIT (see LICENSE file)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendSMS

func SendSMS(c context.Context, to string, body string) error

func SmsHandler

func SmsHandler(w http.ResponseWriter, r *http.Request)

Types

type ApplicationSid

type ApplicationSid string

func (ApplicationSid) GetParam

func (applicationSid ApplicationSid) GetParam() (string, string)

type AreaCode

type AreaCode string

func (AreaCode) GetParam

func (areaCode AreaCode) GetParam() (string, string)

type Body

type Body string

func (Body) GetParam

func (body Body) GetParam() (string, string)

type Callback

type Callback string

func (Callback) GetParam

func (callback Callback) GetParam() (string, string)

type Client

type Client interface {
	AccountSid() string
	AuthToken() string
	RootUrl() string
	// contains filtered or unexported methods
}

type DateSent

type DateSent string

func (DateSent) GetParam

func (dateSent DateSent) GetParam() (string, string)

type Error

type Error struct {
	Description string
}

func (Error) Error

func (e Error) Error() string

type FallbackMethod

type FallbackMethod string

func (FallbackMethod) GetParam

func (fallbackMethod FallbackMethod) GetParam() (string, string)

type FallbackUrl

type FallbackUrl string

func (FallbackUrl) GetParam

func (fallbackUrl FallbackUrl) GetParam() (string, string)

type FriendlyName

type FriendlyName string

func (FriendlyName) GetParam

func (friendlyName FriendlyName) GetParam() (string, string)

type From

type From string

func (From) GetParam

func (from From) GetParam() (string, string)

type IfMachine

type IfMachine string

func (IfMachine) GetParam

func (ifMachine IfMachine) GetParam() (string, string)

type MediaUrl

type MediaUrl string

func (MediaUrl) GetParam

func (mediaUrl MediaUrl) GetParam() (string, string)

type Message

type Message struct {
	Sid         string `json:"sid"`
	DateCreated string `json:"date_created"`
	DateUpdated string `json:"date_updated"`
	DateSent    string `json:"date_sent"`
	AccountSid  string `json:"account_sid"`
	From        string `json:"from"`
	To          string `json:"to"`
	Body        string `json:"body"`
	NumSegments string `json:"num_segments"`
	Status      string `json:"status"`
	Direction   string `json:"direction"`
	Price       string `json:"price"`
	PriceUnit   string `json:"price_unit"`
	ApiVersion  string `json:"api_version"`
	Uri         string `json:"uri"`
}

func NewMessage

func NewMessage(c context.Context, client Client, from string, to string, content ...Optional) (*Message, error)

type Method

type Method string

func (Method) GetParam

func (method Method) GetParam() (string, string)

type Optional

type Optional interface {
	GetParam() (string, string)
}

type ParentCallSid

type ParentCallSid string

func (ParentCallSid) GetParam

func (parentCallSid ParentCallSid) GetParam() (string, string)

type PhoneNumber

type PhoneNumber string

func (PhoneNumber) GetParam

func (phoneNumber PhoneNumber) GetParam() (string, string)

type Record

type Record string

func (Record) GetParam

func (record Record) GetParam() (string, string)

type SendDigits

type SendDigits string

func (SendDigits) GetParam

func (sendDigits SendDigits) GetParam() (string, string)

type StartTime

type StartTime string

func (StartTime) GetParam

func (startTime StartTime) GetParam() (string, string)

type Status

type Status string

func (Status) GetParam

func (status Status) GetParam() (string, string)

type StatusCallback

type StatusCallback string

func (StatusCallback) GetParam

func (statusCallback StatusCallback) GetParam() (string, string)

type StatusCallbackMethod

type StatusCallbackMethod string

func (StatusCallbackMethod) GetParam

func (statusCallbackMethod StatusCallbackMethod) GetParam() (string, string)

type Timeout

type Timeout string

func (Timeout) GetParam

func (timeout Timeout) GetParam() (string, string)

type To

type To string

func (To) GetParam

func (to To) GetParam() (string, string)

type TwilioClient

type TwilioClient struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(accountSid, authToken string) *TwilioClient

func (*TwilioClient) AccountSid

func (client *TwilioClient) AccountSid() string

func (*TwilioClient) AuthToken

func (client *TwilioClient) AuthToken() string

func (*TwilioClient) RootUrl

func (client *TwilioClient) RootUrl() string

type TwilioError

type TwilioError struct {
	Status   int    `json:"status"`
	Message  string `json:"message"`
	Code     int    `json:"code"`
	MoreInfo string `json:"more_info"`
}

func (TwilioError) Error

func (e TwilioError) Error() string

Jump to

Keyboard shortcuts

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