sms

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIKeyEnvVarName       = "AIT_API_KEY"
	APIUsernameEnvVarName  = "AIT_USERNAME"
	APISenderIDEnvVarName  = "AIT_SENDER_ID"
	AITEnvVarName          = "AIT_ENVIRONMENT"
	BeWellAITAPIKey        = "AIT_BEWELL_API_KEY"
	BeWellAITUsername      = "AIT_BEWELL_USERNAME"
	BeWellAITSenderID      = "AIT_BEWELL_SENDER_ID"
	AITAuthenticationError = "The supplied authentication is invalid"

	//AITCallbackCollectionName is the name of a Cloud Firestore collection into which AIT
	// callback data will be saved for future analysis
	AITCallbackCollectionName = "ait_callbacks"
)

AIT environment variables names

Variables

This section is empty.

Functions

func GetAPIHost

func GetAPIHost(env string) string

GetAPIHost returns either sandbox or prod

func GetSmsURL

func GetSmsURL(env string) string

GetSmsURL is the sms endpoint

Types

type ServiceSMS

type ServiceSMS interface {
	SendToMany(
		ctx context.Context,
		message string,
		to []string,
		from enumutils.SenderID,
	) (*dto.SendMessageResponse, error)
	Send(
		ctx context.Context,
		to, message string,
		from enumutils.SenderID,
	) (*dto.SendMessageResponse, error)
}

ServiceSMS defines the interactions with sms service

type ServiceSMSImpl

type ServiceSMSImpl struct {
	Env        string
	Repository database.Repository
	PubSub     messaging.NotificationService
}

ServiceSMSImpl defines a sms service struct

func NewService

func NewService(
	repository database.Repository,
	pubsub messaging.NotificationService,
) *ServiceSMSImpl

NewService returns a new service

func (ServiceSMSImpl) Send

func (s ServiceSMSImpl) Send(
	ctx context.Context,
	to, message string,
	from enumutils.SenderID,
) (*dto.SendMessageResponse, error)

Send is a method used to send to a single recipient

func (ServiceSMSImpl) SendSMS

func (s ServiceSMSImpl) SendSMS(
	ctx context.Context,
	to, message string,
	from string,
	username string,
	key string,
) (*dto.SendMessageResponse, error)

SendSMS is a method used to send SMS

func (ServiceSMSImpl) SendToMany

func (s ServiceSMSImpl) SendToMany(
	ctx context.Context,
	message string,
	to []string,
	from enumutils.SenderID,
) (*dto.SendMessageResponse, error)

SendToMany is a utility method to send to many recipients at the same time

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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