sms

package module
v0.0.0-...-a1ae211 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

README

sms

What is sms?

A simple Golang sms library. Use email to send a sms. inspired from sms-fu.

Install

go get github.com/acmacalister/sms

Usage

sms is really simple. Check out the example below or have a look at the test. Note for the test to run you need to update the sms.yml with your own email account's username/password and a phone number to successfully send a sms.

package main

import (
  "github.com/acmacalister/sms"
  "log"
)

func main() {
  client, err := createClient("smtp.gmail.com", 587, "tester@gmail.com", "test")
  if err != nil {
    log.Fatal(err)
  }
  if err := client.Deliver("5555555555", "AT&T", "sms golang library!"); err != nil {
    log.Fatal(err)
  }
}
License

sms is licensed under the Apache License.

Authors
ToDo
  • Test other carriers. (Currently only AT&T has been tested.)
  • Bring test coverage from 75% to 100%.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FromAddress string            `yaml:"from_address"`
	Carriers    map[string]string `yaml:"carriers"`
}

type SMSClient

type SMSClient struct {
	Address  string
	Port     int
	Username string
	Password string
	// contains filtered or unexported fields
}

func (*SMSClient) Deliver

func (client *SMSClient) Deliver(number, carrier, message string) error

Jump to

Keyboard shortcuts

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