smshandler

package module
v0.0.5 Latest Latest
Warning

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

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

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 struct {
	Client *http.Client
}

HTTPHandler holds interface for HTTP client usage that implemented by each provider

type Response

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

Response holds interface for

type XMLHandler

type XMLHandler interface {
	SendSMS(h HTTPHandler) (*http.Response, error)
}

XMLHandler is an interface to send and post SMS messages

type XMLResponse

type XMLResponse struct{}

XMLResponse holds interface for XMLResponse that are implemented on each provider

Jump to

Keyboard shortcuts

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