smsglobal

package
v0.0.0-...-83dca6d Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 9 Imported by: 0

README

GoCryptoTrader package Smsglobal

Build Status Software License GoDoc Coverage Status Go Report Card

This smsglobal package is part of the GoCryptoTrader codebase.

This is still in active development

You can track ideas, planned features and what's in progress on this Trello board: https://trello.com/b/ZAhMhpOy/gocryptotrader.

Join our slack to discuss all things related to GoCryptoTrader! GoCryptoTrader Slack

SMSGlobal Communications package

What is SMSGlobal?
  • SMSGlobal allows bulk sending of messages via their API
  • Please visit: SMSGlobal for more information and account setup
Current Features
  • Sending of events to a list of recipients
How to enable
import (
"github.com/thrasher-corp/gocryptotrader/communications/smsglobal"
"github.com/thrasher-corp/gocryptotrader/config"
)

s := new(smsglobal.SMSGlobal)

// Define SMSGlobal configuration
commsConfig := config.CommunicationsConfig{SMSGlobalConfig: config.SMSGlobalConfig{
	Name:     "SMSGlobal",
	Enabled:  true,
	Verbose:  false,
	Username: "username",
	Password: "password",
	Contacts: []config.SMSContact{}
}}

s.Setup(commsConfig)
err := s.Connect
// Handle error
Please click GoDocs chevron above to view current GoDoc information for this package

Contribution

Please feel free to submit any pull requests or suggest any desired features to be added.

When submitting a PR, please abide by our coding guidelines:

  • Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
  • Code must be documented adhering to the official Go commentary guidelines.
  • Code must adhere to our coding style.
  • Pull requests need to be based on and opened against the master branch.

Donations

If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:

bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc

Documentation

Overview

Package smsglobal allows bulk messaging to a desired recipient list

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	Name    string `json:"Name"`
	Number  string `json:"Number"`
	Enabled bool   `json:"Enabled"`
}

Contact struct stores information related to a SMSGlobal contact

type SMSGlobal

type SMSGlobal struct {
	base.Base
	Contacts []Contact
	Username string
	Password string
	SendFrom string
}

SMSGlobal is the overarching type across this package

func (*SMSGlobal) AddContact

func (s *SMSGlobal) AddContact(contact Contact) error

AddContact checks to see if a contact exists and adds them if it doesn't

func (*SMSGlobal) Connect

func (s *SMSGlobal) Connect() error

Connect connects to the service

func (*SMSGlobal) ContactExists

func (s *SMSGlobal) ContactExists(contact Contact) bool

ContactExists checks to see if a contact exists

func (*SMSGlobal) GetContactByName

func (s *SMSGlobal) GetContactByName(name string) (Contact, error)

GetContactByName returns a contact with supplied name

func (*SMSGlobal) GetContactByNumber

func (s *SMSGlobal) GetContactByNumber(number string) (Contact, error)

GetContactByNumber returns a contact with supplied number

func (*SMSGlobal) GetEnabledContacts

func (s *SMSGlobal) GetEnabledContacts() int

GetEnabledContacts returns how many SMS contacts are enabled in the contact list

func (*SMSGlobal) IsConnected

func (s *SMSGlobal) IsConnected() bool

IsConnected returns whether or not the connection is connected

func (*SMSGlobal) PushEvent

func (s *SMSGlobal) PushEvent(event base.Event) error

PushEvent pushes an event to a contact list via SMS

func (*SMSGlobal) RemoveContact

func (s *SMSGlobal) RemoveContact(contact Contact) error

RemoveContact removes a contact if it exists

func (*SMSGlobal) SendMessage

func (s *SMSGlobal) SendMessage(to, message string) error

SendMessage sends a message to an individual contact

func (*SMSGlobal) SendMessageToAll

func (s *SMSGlobal) SendMessageToAll(message string) error

SendMessageToAll sends a message to all enabled contacts in cfg

func (*SMSGlobal) Setup

func (s *SMSGlobal) Setup(cfg *base.CommunicationsConfig)

Setup takes in a SMSGlobal configuration, sets username, password and and recipient list

Jump to

Keyboard shortcuts

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