utils

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateEventWrapper

func CreateEventWrapper(eventType string) *event.Event

CreateEventWrapper creates a new event with the specified event type

func FmtDuration

func FmtDuration(d time.Duration) string

FmtDuration is a helper function to format a duration in the HH:MM:SS.sss format

func SendEmail added in v1.0.8

func SendEmail(subject string, body string, recipients []string) error

SendEmail function send email. It uses emailSender interface.

func SetEmailSender added in v1.0.8

func SetEmailSender(es EmailSender)

SetEmailSender sets up default email sender

func SetSnsEmailSender added in v1.0.8

func SetSnsEmailSender(awsSession *session.Session, snsEventTopicARN string, senderEmailAddress string)

SetSnsEmailSender set sns as mechanism to send email

func ToEmailEvent

func ToEmailEvent(sender *string, recipients []string, subject *string, emailBody *string) *emailevent.EmailEvent

ToEmailEvent converts an organization model into a create org event model

Types

type EmailSender added in v1.0.8

type EmailSender interface {
	SendEmail(subject string, body string, recipients []string) error
}

EmailSender contains method to send email

type Service added in v1.0.8

type Service interface {
}

Service interface defines methods of event service

func NewService added in v1.0.8

func NewService() Service

NewService creates new instance of event service

Jump to

Keyboard shortcuts

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