sms

package
v1.3.115 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const Kavenegar = "kavenegar"
View Source
const LinkMobility = "link-mobility"
View Source
const Mobica = "mobica"
View Source
const (
	Sinch = "sinch"
)
View Source
const Twilio = "twilio"

Variables

This section is empty.

Functions

This section is empty.

Types

type DBLog

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

func (*DBLog) Do

func (db *DBLog) Do()

type IProvider added in v1.2.74

type IProvider interface {
	SendSMSMessage(msg *Message) (string, error)
	GetName() string
}

func NewKavenegarProvider added in v1.2.74

func NewKavenegarProvider(configService config.IConfig, _ clock.IClock) (IProvider, error)

func NewLinkMobilityProvider added in v1.2.74

func NewLinkMobilityProvider(configService config.IConfig, _ clock.IClock) (IProvider, error)

func NewLinkMobilityProviderNoConfig added in v1.2.74

func NewLinkMobilityProviderNoConfig(_ config.IConfig, _ clock.IClock) (IProvider, error)

func NewMobicaProvider added in v1.2.74

func NewMobicaProvider(configService config.IConfig, _ clock.IClock) (IProvider, error)

func NewMobicaProviderNoConfig added in v1.2.74

func NewMobicaProviderNoConfig(_ config.IConfig, _ clock.IClock) (IProvider, error)

func NewSinchProvider added in v1.2.74

func NewSinchProvider(configService config.IConfig, clockService clock.IClock) (IProvider, error)

func NewTwilioProvider added in v1.2.74

func NewTwilioProvider(configService config.IConfig, _ clock.IClock) (IProvider, error)

type ISender

type ISender interface {
	SendMessage(ormService *beeorm.Engine, message *Message) error
}

type KavenegarProvider added in v1.2.74

type KavenegarProvider struct {
	APIKey string
	Sender string
}

func (*KavenegarProvider) GetName added in v1.2.74

func (g *KavenegarProvider) GetName() string

func (*KavenegarProvider) SendSMSMessage added in v1.2.74

func (g *KavenegarProvider) SendSMSMessage(message *Message) (string, error)

type LinkMobilityProvider added in v1.2.74

type LinkMobilityProvider struct {
	Service   int
	Key       string
	Secret    string
	Endpoint  string
	Shortcode int
}

func (*LinkMobilityProvider) GetName added in v1.2.74

func (g *LinkMobilityProvider) GetName() string

func (*LinkMobilityProvider) SendSMSMessage added in v1.2.74

func (g *LinkMobilityProvider) SendSMSMessage(message *Message) (string, error)

type LogEntity

type LogEntity interface {
	beeorm.Entity
	SetStatus(string)
	SetTo(string)
	SetText(string)
	SetFromPrimaryProvider(string)
	SetFromSecondaryProvider(string)
	SetPrimaryProviderError(string)
	SetSecondaryProviderError(string)
	SetType(string)
	SetSentAt(time time.Time)
}

type Logger

type Logger interface {
	Do()
}

func NewSmsLog

func NewSmsLog(ormService *beeorm.Engine, entity LogEntity) Logger

type Message

type Message struct {
	Text     string
	Number   string
	Provider *Provider
}

type MobicaProvider added in v1.2.74

type MobicaProvider struct {
	Username string
	Password string
	Route    string
	From     string
	Endpoint string
}

func (*MobicaProvider) GetName added in v1.2.74

func (g *MobicaProvider) GetName() string

func (*MobicaProvider) SendSMSMessage added in v1.2.74

func (g *MobicaProvider) SendSMSMessage(message *Message) (string, error)

type NewProviderFunc added in v1.2.74

type NewProviderFunc func(configService config.IConfig, clockService clock.IClock) (IProvider, error)

type Provider

type Provider struct {
	Primary   IProvider
	Secondary IProvider
}

type Sender

type Sender struct {
	ConfigService      config.IConfig
	ClockService       clock.IClock
	ErrorLoggerService errorlogger.ErrorLogger
	PrimaryProvider    IProvider
	SecondaryProvider  IProvider
}

func (*Sender) SendMessage

func (s *Sender) SendMessage(ormService *beeorm.Engine, message *Message) error

type SinchProvider added in v1.2.74

type SinchProvider struct {
	Clock      clock.IClock
	AppID      string
	AppSecret  string
	MsgURL     string
	FromNumber string
}

func (*SinchProvider) GetName added in v1.2.74

func (g *SinchProvider) GetName() string

func (*SinchProvider) SendSMSMessage added in v1.2.74

func (g *SinchProvider) SendSMSMessage(message *Message) (string, error)

type TwilioProvider added in v1.2.74

type TwilioProvider struct {
	SID        string
	Token      string
	FromNumber string
}

func (*TwilioProvider) GetName added in v1.2.74

func (g *TwilioProvider) GetName() string

func (*TwilioProvider) SendSMSMessage added in v1.2.74

func (g *TwilioProvider) SendSMSMessage(message *Message) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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