rest

package
v0.0.0-...-692750e Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxIdleConnections int = 20
	RequestTimeout     int = 10

	PING_RESOURCE string = "/ping"
)

Constants

View Source
const (
	MESSAGING_RESOURCE string = "/v1/messaging"
	STATUS_RESOURCE    string = "/v1/messaging/"
)
View Source
const (
	VOICE_RESOURCE        string = "/v1/voice"
	VOICE_STATUS_RESOURCE string = "/v1/voice/"
)
View Source
const (
	PHONEID_RESOURCE string = "/v1/phoneid/"
)
View Source
const (
	SCORE_RESOURCE string = "/v1/score/"
)
View Source
const (
	VERIFICATION_STATUS_RESOURCE string = "/v1/mobile/verification/status/"
)

Variables

This section is empty.

Functions

func GenerateTelesignHeaders

func GenerateTelesignHeaders(
	customer_id string,
	secret_key string,
	method_name string,
	resource string,
	url_encoded_fields string,
	curr_date string,
	nonce string,
	user_agent string) (headers map[string]string)

func SetAPIHost

func SetAPIHost(hostname string)

func SetCustomerID

func SetCustomerID(cid string)

Configure API methods

func SetSecretKey

func SetSecretKey(key string)

Types

type TSResponse

type TSResponse struct {
	Ok         bool
	StatusCode int
	Header     http.Header
	Body       []byte
}

Telesign response structure

func Call

func Call(phone_number string, message string, message_type string, params map[string]string) TSResponse

func CallStatus

func CallStatus(reference_id string, params map[string]string) TSResponse

func Delete

func Delete(resource string, fields url.Values) (response TSResponse)

func Get

func Get(resource string, fields url.Values) (response TSResponse)

func Message

func Message(phone_number string, message string, message_type string, params map[string]string) TSResponse

func MessageStatus

func MessageStatus(reference_id string, params map[string]string) TSResponse

func PhoneID

func PhoneID(phone_number string, params map[string]string) TSResponse

func Ping

func Ping() TSResponse

func Post

func Post(resource string, fields url.Values) (response TSResponse)

func Put

func Put(resource string, fields url.Values) (response TSResponse)

func Score

func Score(phone_number string, account_lifecycle_event string, params map[string]string) TSResponse

func VerificationStatus

func VerificationStatus(external_id string, params map[string]string) TSResponse

Jump to

Keyboard shortcuts

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