ghasedak

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

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

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 9 Imported by: 1

README

ghasedak-go

Ghasedak sms gateway for golang.

install

go get github.com/ghasedakapi/ghasedak-go

example

package main

import (
	"fmt"

	ghasedak "github.com/ghasedakapi/ghasedak-go"
)

func main() {

	// initialize connection:
	c := ghasedak.NewClient("api_key", "")

	// Send a new text massage:
	r := c.Send("Hello world!", "09xxxxxxxx")
	fmt.Println(r.Code)
	fmt.Println(r.Message)

	// Send group massages:
	r := c.Bulk1("Hello world!", "09xxxxxxxx,09xxxxxxxx,09xxxxxxxx")
	fmt.Println(r.Code)
	fmt.Println(r.Message)
	// -----------
	r := c.Bulk2("Hello world!", "09xxxxxxxx,09xxxxxxxx,09xxxxxxxx")
	fmt.Println(r.Code)
	fmt.Println(r.Message)

	// Check the status of massages:
	r := c.Status("Massage_ID", "1")
	fmt.Println(r.Message)
	fmt.Println(r.Code)

	// Send verification massages:
	r := c.SendOTP("09xxxxxxxxx", "Your Template", Param1)
	fmt.Println(r.Message)
	fmt.Println(r.Code)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	APIKEY     string
	LineNumber string
	// contains filtered or unexported fields
}

Client type

func NewClient

func NewClient(apikey, linenumber string) Client

NewClient create new ghasedak client

func (*Client) Bulk1

func (c *Client) Bulk1(msg, receptor string) Response

Send group sms

func (*Client) Bulk2

func (c *Client) Bulk2(msg, receptor string) Response

func (*Client) Send

func (c *Client) Send(msg, receptor string) Response

Send simple sms

func (*Client) SendOTP

func (c *Client) SendOTP(receptor string, template string, code int) Response

func (*Client) SendVoice

func (c *Client) SendVoice(message string, receptor string, template string) Response

func (*Client) SetHost

func (c *Client) SetHost(host string)

func (*Client) Status

func (c *Client) Status(id string, itype string) Response

get status

type Response

type Response struct {
	Success bool
	Code    int
	Message string
	ID      int64
}

Response type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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