smshandler

package module
Version: v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: Apache-2.0 Imports: 9 Imported by: 3

README

smshandler

Golang interface for sending and getting SMS from SMS(c) providers

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoHTTP

func DoHTTP(client *http.Client, method, contentType, address string,
	fields url.Values, body []byte, onResponse Response) (resp *http.Response, err error)

DoHTTP sends an HTTP Request for sending an SMS

func OnGettingSMS

func OnGettingSMS(path string, mux *http.ServeMux, httpHandler http.HandlerFunc)

OnGettingSMS is an HTTP server handler when incoming SMS arrives. If mux exists, it will use it for a server, otherwise it will use http.HandleFunc.

Types

type HTTPHandler

type HTTPHandler interface {
	DoHTTP(method, contentType, address string, fields url.Values, body []byte) (resp *http.Response, err error)
	OnGettingSMS(path string, mux *http.ServeMux, httpHandler http.HandlerFunc)
}

HTTPHandler interface for working with HTTP client interface

type RESTHandler

type RESTHandler interface {
	SendSMS(method string, client *http.Client, onResponse Response) (*http.Response, error)
}

RESTHandler is an interface to send and post SMS messages using HTTP REST

type Response

type Response interface {
	FromResponse(status []byte) error
	ToError() error
	IsOK() bool
}

Response holds interface for

type XMLHandler

type XMLHandler interface {
	SendSMS(client *http.Client) (*http.Response, error)
}

XMLHandler is an interface to send and post SMS messages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL