sms_jatis

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 10 Imported by: 0

README

Hi 👋, This is SMS Jatis Library

This library for sms integration to Jatis.

How to use :

Documentation

Index

Constants

View Source
const (
	ErrorGeneral             = 0
	StatusSuccess            = 1
	ErrorMissingParameter    = 2
	ErrorInvalidUserPassword = 3
	ErrorInvalidMessage      = 4
	ErrorRecepientNumber     = 5
	ErrorInvalidSender       = 6
	ErrorIPNotAllowed        = 7
	ErrorInternal            = 8
	ErrorInvalidDivision     = 9
	ErrorInvalidChannel      = 20
	ErrorInsufficientToken   = 21
	ErrorTokenNotAvailable   = 22
)
View Source
const (
	CHANNEL_REGULAR = "0"
	CHANNEL_ALERT   = "1"
	CHANNEL_OTP     = "2"
)

Variables

View Source
var JatisError = map[int]string{
	ErrorMissingParameter:    "missing Parameter",
	ErrorInvalidUserPassword: "invalid user or password",
	ErrorInvalidMessage:      "invalid message",
	ErrorRecepientNumber:     "invalid recipient number",
	ErrorInvalidSender:       "invalid sender name",
	ErrorIPNotAllowed:        "ip address not allowed",
	ErrorInternal:            "internal server error",
	ErrorInvalidDivision:     "invalid division name",
	ErrorInvalidChannel:      "invalid channel type",
	ErrorInsufficientToken:   "insufficient token",
	ErrorTokenNotAvailable:   "token not available",
	ErrorGeneral:             "unknown error",
}

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseUrl  string
	UserId   string
	Password string
	Sender   string
	Division string
	UploadBy string

	ConnectTimeout int
	// contains filtered or unexported fields
}

Config config app for Jatis

type ReqMessage

type ReqMessage struct {
	PhoneNumber string
	Text        string
}

ReqMessage Request for client

type ResponseBody

type ResponseBody struct {
	MessageId string
	To        string
	Status    string
}

type Sender

type Sender struct {
	Config Config
}

func New

func New(config Config) *Sender

func (*Sender) SendSMS

func (s *Sender) SendSMS(ctx context.Context, request ReqMessage) (respBody ResponseBody, err error)

SendSMS function to send message

Jump to

Keyboard shortcuts

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