Documentation ¶
Index ¶
- Constants
- func GetAPIHost(env string) string
- func GetSmsURL(env string) string
- type ServiceSMS
- type ServiceSMSImpl
- func (s ServiceSMSImpl) Send(ctx context.Context, to, message string, from enumutils.SenderID) (*dto.SendMessageResponse, error)
- func (s ServiceSMSImpl) SendSMS(ctx context.Context, to, message string, from string, username string, ...) (*dto.SendMessageResponse, error)
- func (s ServiceSMSImpl) SendToMany(ctx context.Context, message string, to []string, from enumutils.SenderID) (*dto.SendMessageResponse, error)
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 ¶
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
Click to show internal directories.
Click to hide internal directories.