smsclub

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

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

Go to latest
Published: Apr 21, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

README

smsclub

Golang (>= go1.7) package for sending SMS via SMS Club. See Connection to the SMS-gateway, API for details.

It's simple!

Install package:

$ go get -u github.com/runningmaster/smsclub

Send SMS to friends:

sms, _ := smsclub.New(
	smsclub.User("user"),
	smsclub.Token("user_token"),
	smsclub.Sender("alpha_name"),
)
sms.Send("Hello dudes!", "380673408275", "380975243263")

Documentation

Overview

Package smsclub is a golang package for sending SMS via https://smsclub.mobi/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LifeTime

func LifeTime(d time.Duration) func(*option) error

LifeTime sets life time of SMS, which is specified in minutes.

func Sender

func Sender(val string) func(*option) error

Sender is Sender ID, from which mail-out is perfomed (11 English letters, numbers, spaces). See https://my.smsclub.mobi/en/alphanames/index.

func Timeout

func Timeout(d time.Duration) func(*option) error

Timeout sets timeout for calls Balance, Send and Status.

func Token

func Token(val string) func(*option) error

Token is token of user’s account (you can find it in profile).

func User

func User(name string) func(*option) error

User is login of user’s account

Types

type SMSCluber

type SMSCluber interface {
	// Balance returns values for balance and credit.
	Balance() (float64, float64, error)

	// Send sends SMS text message to recipients.
	Send(text string, to ...string) ([]string, error)

	// Status gets list of SMS identifiers and returns statuses for ones.
	Status(id ...string) ([]string, error)
}

SMSCluber is interface for https://smsclub.mobi/en/pages/show/api

func New

func New(options ...func(*option) error) (SMSCluber, error)

New returns SMSCluber interface. Minimal *must* options are User(), Token().

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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