goetxt

package module
v0.0.0-...-192aec7 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: MIT Imports: 11 Imported by: 0

README

GoEtxt

A Golang library for sending and receiving text messages via Email

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func Init

func Init(username, password string) *Client

func (*Client) GetInboxes

func (inst *Client) GetInboxes() ([]*imap.MailboxInfo, error)

func (*Client) GetMessages

func (inst *Client) GetMessages(mailbox string, recipient *string, number *uint32) ([]*Message, error)

GetMessages returns all messages in a specified inbox If recipient is not empty, only messages with that recipient will be returned If number is not empty, only 1 message will be returned.

func (*Client) Init

func (inst *Client) Init(username, password string)

func (*Client) KeepAlive

func (inst *Client) KeepAlive()

func (*Client) OnMessage

func (inst *Client) OnMessage(handler func(msg *Message))

func (*Client) SendSMS

func (inst *Client) SendSMS(msg Message) error

type Message

type Message struct {
	MessageType MessageType
	Message     string
	// 10 digit phone number, without dashes
	Recipient string
	Time      time.Time
}

type MessageType

type MessageType int
const (
	ATTSMS         MessageType = 0x01
	ATTMMS         MessageType = 0x02
	BoostSMS       MessageType = 0x03
	BoostMMS       MessageType = 0x04
	CricketSMS     MessageType = 0x05
	CricketMMS     MessageType = 0x06
	SprintSMS      MessageType = 0x07
	SprintMMS      MessageType = 0x08
	StraighTalkSMS MessageType = 0x09
	StraighTalkMMS MessageType = 0x0A
	TMobileSMS     MessageType = 0x0B
	TMobileMMS     MessageType = 0x0C
	USCellularSMS  MessageType = 0x0D
	USCellularMMS  MessageType = 0x0E
	VerizonSMS     MessageType = 0x0F
	VerizonMMS     MessageType = 0x10
	VirginSMS      MessageType = 0x11
	VirginMMS      MessageType = 0x12
)

Jump to

Keyboard shortcuts

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