zend

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

README

sdk-go

Message

It's easy to send message to any number using the SDK, all you have to do is the following.

import (
    "fmt"
    "github.com/zendlk/go-sdk"
)

Zend := zend.NewClient("{_token_}", "{_masking_}")
message, err := Zend.Message.Send("+94777123456", "Message text here")
if err != nil { fmt.Println(err) }
fmt.Println( message )

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Token   string
	Sender  string
	Version string
	URI     string

	Otp     *OtpService
	Message *MessageService
}

func NewClient

func NewClient(token string, sender string) *Client

func (*Client) Dispatch

func (c *Client) Dispatch(request *http.Request) (map[string]interface{}, error)

type Message

type Message struct {
	ID uint64
}

type MessageService added in v1.2.0

type MessageService struct {
	// contains filtered or unexported fields
}

func (*MessageService) Send added in v1.2.0

func (svc *MessageService) Send(recipient string, message string) (*Message, error)

type Otp added in v1.1.0

type Otp struct {
	ID   uint64
	Time Times
}

type OtpService added in v1.2.0

type OtpService struct {
	// contains filtered or unexported fields
}

func (*OtpService) Send added in v1.2.0

func (svc *OtpService) Send(recipient string) (*Otp, error)

func (*OtpService) Verify added in v1.2.0

func (svc *OtpService) Verify(otp_id string, code string) (bool, error)

type Times added in v1.2.0

type Times struct {
	Created uint64
	Updated uint64
	Deleted uint64
	Expires uint64
}

Jump to

Keyboard shortcuts

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