Documentation ¶
Index ¶
- Constants
- Variables
- func API(request rest.Request) (*rest.Response, error)
- func GetRequest(key, endpoint, host string) rest.Request
- func GetRequestSubuser(key, endpoint, host, subuser string) rest.Request
- func GetTwilioEmailRequest(twilioEmailOptions TwilioEmailOptions) rest.Request
- func MakeRequest(request rest.Request) (*rest.Response, error)
- func MakeRequestAsync(request rest.Request) (chan *rest.Response, chan error)
- func MakeRequestAsyncWithContext(ctx context.Context, request rest.Request) (chan *rest.Response, chan error)
- func MakeRequestRetry(request rest.Request) (*rest.Response, error)
- func MakeRequestRetryWithContext(ctx context.Context, request rest.Request) (*rest.Response, error)
- func MakeRequestWithContext(ctx context.Context, request rest.Request) (*rest.Response, error)
- type Client
- type TwilioEmailOptions
Constants ¶
const (
Version = "3.10.2"
)
Version is this client library's current version
Variables ¶
var DefaultClient = rest.DefaultClient
DefaultClient is used if no custom HTTP client is defined
Functions ¶
func API ¶
API sets up the request to the Twilio SendGrid API, this is main interface. Please use the MakeRequest or MakeRequestAsync functions instead. (deprecated)
func GetRequest ¶
GetRequest @return [Request] a default request object
func GetRequestSubuser ¶ added in v3.5.0
GetRequestSubuser like GetRequest but with On-Behalf of Subuser @return [Request] a default request object
func GetTwilioEmailRequest ¶ added in v3.6.0
func GetTwilioEmailRequest(twilioEmailOptions TwilioEmailOptions) rest.Request
GetTwilioEmailRequest create Request @return [Request] a default request object
func MakeRequest ¶ added in v3.5.0
MakeRequest attempts a Twilio SendGrid request synchronously.
func MakeRequestAsync ¶ added in v3.5.0
MakeRequestAsync attempts a request asynchronously in a new go routine. This function returns two channels: responses and errors. This function will retry in the case of a rate limit.
func MakeRequestAsyncWithContext ¶ added in v3.10.0
func MakeRequestAsyncWithContext(ctx context.Context, request rest.Request) (chan *rest.Response, chan error)
MakeRequestAsyncWithContext attempts a request asynchronously in a new go routine with context.Context. This function returns two channels: responses and errors. This function will retry in the case of a rate limit.
func MakeRequestRetry ¶ added in v3.5.0
MakeRequestRetry a synchronous request, but retry in the event of a rate limited response.
func MakeRequestRetryWithContext ¶ added in v3.10.0
MakeRequestRetryWithContext a synchronous request with context.Context, but retry in the event of a rate limited response.
Types ¶
type Client ¶ added in v3.4.0
Client is the Twilio SendGrid Go client
func NewSendClient ¶ added in v3.4.0
NewSendClient constructs a new Twilio SendGrid client given an API key
func NewTwilioEmailSendClient ¶ added in v3.6.0
NewTwilioEmailSendClient constructs a new Twilio Email client given a username and password