Help us shape the future of Go! Take the 2026 Go Developer Survey

gobudgetsms

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

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

Go to latest
Published: Nov 4, 2018 License: MIT Imports: 4 Imported by: 0

README

Gobudgetsms

This library is used to easily make use of the Budget SMS public API to send sms, plus it lets to create message of variable length.

Getting Started

Just insert the details according to the example provided below and get going. No dependencies are requied to use this lib, very lightweight.

Prerequisites

You need to have an account on Budget SMS.

Installing
go get github.com/souvikhaldar/gobudgetsms

Example

Details regarding account can be found here https://www.budgetsms.net/controlpanel/api-details/ Set the credentials from your Budget SMS account, visit https://www.budgetsms.net/sms-http-api/send-sms/

  import (
	  "log"

	  "github.com/souvikhaldar/gobudgetsms"
  )

  func main() {
	  conf := gobudgetsms.SetConfig("username","userid","handle","customid",price,mccmnc,credit)
	  res, er := gobudgetsms.SendSMS(conf,message,"+to","from")
	  if er != nil {
		  log.Fatal(er.Error())
	  }
	  log.Print("The response after sending sms is ", res)
  }

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendSMS

func SendSMS(details Details, message, to, from string) (string, error)

SendSMS returns the response after requesting Budget SMS api and the error if any

Types

type Details

type Details struct {
	Username string
	Userid   string
	Handle   string
	Msg      string
	From     string
	To       string
	Customid string
	Price    int
	Mccmnc   int
	Credit   int
}

Details has all the credentials of the Budget SMS account as well as the details regarding the SMS

func SetConfig

func SetConfig(Username, Userid, Handle, Customid string, Price, Mccmnc, Credit int) Details

SetConfig allows to enter the credentials of Budget sms account

Jump to

Keyboard shortcuts

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