Documentation
¶
Index ¶
- Constants
- func CCErrorFor(err error) error
- func ResetLoader()
- func UAAErrorFor(err error) error
- type CCDownError
- type CCNotFoundError
- type CriticalNotificationError
- type Delivery
- type DeliveryWorker
- type EmailID
- type EmailRecipe
- type FileSystem
- type FileSystemInterface
- type GUIDGenerationFunc
- type HTML
- type Mailer
- type MailerInterface
- type MessageContext
- type Options
- type OrganizationGUID
- type OrganizationRecipe
- type Packager
- type RecipeInterface
- type Response
- type SpaceAndOrgLoader
- type SpaceAndOrgLoaderInterface
- type SpaceGUID
- type SpaceRecipe
- type TemplateLoadError
- type Templates
- type TemplatesLoader
- type TemplatesLoaderInterface
- type TokenLoader
- type TokenLoaderInterface
- type Trimmer
- type TypedGUID
- type UAA
- type UAADownError
- type UAAGenericError
- type UAAInterface
- type UAAScopesError
- type UAAUserNotFoundError
- type UserGUID
- type UserLoader
- type UserLoaderInterface
- type UserRecipe
Constants ¶
View Source
const ( EmailFieldName = "email" RecipientsFieldName = "recipient" EmptyIDForNonUser = "" )
View Source
const ( StatusFailed = "failed" StatusDelivered = "delivered" StatusNotFound = "notfound" StatusNoAddress = "noaddress" StatusQueued = "queued" )
View Source
const ( SubjectMissingTemplateName = "subject.missing" SubjectProvidedTemplateName = "subject.provided" )
View Source
const ( UserContentSuffix = "user_body" OrganizationContentSuffix = "organization_body" SpaceContentSuffix = "space_body" SubjectProvidedSuffix = "subject.provided" SubjectMissingSuffix = "subject.missing" )
Variables ¶
This section is empty.
Functions ¶
func CCErrorFor ¶
func ResetLoader ¶
func ResetLoader()
func UAAErrorFor ¶
Types ¶
type CCDownError ¶
type CCDownError string
func (CCDownError) Error ¶
func (err CCDownError) Error() string
type CCNotFoundError ¶
type CCNotFoundError string
func (CCNotFoundError) Error ¶
func (err CCNotFoundError) Error() string
type CriticalNotificationError ¶
type CriticalNotificationError struct {
// contains filtered or unexported fields
}
func NewCriticalNotificationError ¶
func NewCriticalNotificationError(kindID string) CriticalNotificationError
func (CriticalNotificationError) Error ¶
func (err CriticalNotificationError) Error() string
type DeliveryWorker ¶
func NewDeliveryWorker ¶
func NewDeliveryWorker(id int, logger *log.Logger, mailClient mail.ClientInterface, queue gobble.QueueInterface, globalUnsubscribesRepo models.GlobalUnsubscribesRepoInterface, unsubscribesRepo models.UnsubscribesRepoInterface, kindsRepo models.KindsRepoInterface, database models.DatabaseInterface, sender, encryptionKey string) DeliveryWorker
func (DeliveryWorker) Deliver ¶
func (worker DeliveryWorker) Deliver(job *gobble.Job)
func (DeliveryWorker) Retry ¶
func (worker DeliveryWorker) Retry(job *gobble.Job)
func (DeliveryWorker) ShouldDeliver ¶
func (worker DeliveryWorker) ShouldDeliver(delivery Delivery) bool
type EmailID ¶
type EmailID string
func NewEmailID ¶
func NewEmailID() EmailID
func (EmailID) BelongsToOrganization ¶
func (EmailID) BelongsToSpace ¶
func (EmailID) IsTypeEmail ¶
type EmailRecipe ¶
type EmailRecipe struct {
// contains filtered or unexported fields
}
func NewEmailRecipe ¶
func NewEmailRecipe(mailer MailerInterface, templatesLoader TemplatesLoaderInterface) EmailRecipe
func (EmailRecipe) Dispatch ¶
func (recipe EmailRecipe) Dispatch(clientID string, guid TypedGUID, options Options, conn models.ConnectionInterface) ([]Response, error)
func (EmailRecipe) Trim ¶
func (recipe EmailRecipe) Trim(responses []byte) []byte
type FileSystem ¶
type FileSystem struct{}
func NewFileSystem ¶
func NewFileSystem() *FileSystem
func (FileSystem) Exists ¶
func (fs FileSystem) Exists(path string) bool
type FileSystemInterface ¶
type GUIDGenerationFunc ¶
type GUIDGenerationFunc func() (*uuid.UUID, error)
type Mailer ¶
type Mailer struct {
// contains filtered or unexported fields
}
func NewMailer ¶
func NewMailer(queue gobble.QueueInterface, guidGenerator GUIDGenerationFunc) Mailer
type MailerInterface ¶
type MailerInterface interface {
Deliver(models.ConnectionInterface, Templates, map[string]uaa.User, Options, cf.CloudControllerSpace, cf.CloudControllerOrganization, string) []Response
}
type MessageContext ¶
type MessageContext struct {
From string
ReplyTo string
To string
Subject string
Text string
HTML string
HTMLComponents HTML
TextTemplate string
HTMLTemplate string
SubjectTemplate string
KindDescription string
SourceDescription string
UserGUID string
ClientID string
MessageID string
Space string
SpaceGUID string
Organization string
OrganizationGUID string
UnsubscribeID string
}
func NewMessageContext ¶
func NewMessageContext(delivery Delivery, sender string, cloak conceal.CloakInterface) MessageContext
func (*MessageContext) Escape ¶
func (context *MessageContext) Escape()
type OrganizationGUID ¶
type OrganizationGUID string
func NewOrganizationGUID ¶
func NewOrganizationGUID() OrganizationGUID
func (OrganizationGUID) BelongsToOrganization ¶
func (guid OrganizationGUID) BelongsToOrganization() bool
func (OrganizationGUID) BelongsToSpace ¶
func (guid OrganizationGUID) BelongsToSpace() bool
func (OrganizationGUID) IsTypeEmail ¶
func (guid OrganizationGUID) IsTypeEmail() bool
func (OrganizationGUID) String ¶
func (guid OrganizationGUID) String() string
type OrganizationRecipe ¶
type OrganizationRecipe struct {
// contains filtered or unexported fields
}
func NewOrganizationRecipe ¶
func NewOrganizationRecipe(tokenLoader TokenLoaderInterface, userLoader UserLoaderInterface, spaceAndOrgLoader SpaceAndOrgLoaderInterface, templatesLoader TemplatesLoaderInterface, mailer MailerInterface, receiptsRepo models.ReceiptsRepoInterface) OrganizationRecipe
func (OrganizationRecipe) Dispatch ¶
func (recipe OrganizationRecipe) Dispatch(clientID string, guid TypedGUID, options Options, conn models.ConnectionInterface) ([]Response, error)
func (OrganizationRecipe) Trim ¶
func (recipe OrganizationRecipe) Trim(responses []byte) []byte
type Packager ¶
type Packager struct{}
func NewPackager ¶
func NewPackager() Packager
func (Packager) CompileBody ¶
func (packager Packager) CompileBody(context MessageContext) (string, error)
type RecipeInterface ¶
type SpaceAndOrgLoader ¶
type SpaceAndOrgLoader struct {
// contains filtered or unexported fields
}
func NewSpaceAndOrgLoader ¶
func NewSpaceAndOrgLoader(cloudController cf.CloudControllerInterface) SpaceAndOrgLoader
func (SpaceAndOrgLoader) Error ¶
func (loader SpaceAndOrgLoader) Error(err error) (cf.CloudControllerSpace, cf.CloudControllerOrganization, error)
func (SpaceAndOrgLoader) Load ¶
func (loader SpaceAndOrgLoader) Load(guid TypedGUID, token string) (cf.CloudControllerSpace, cf.CloudControllerOrganization, error)
type SpaceAndOrgLoaderInterface ¶
type SpaceAndOrgLoaderInterface interface {
Load(TypedGUID, string) (cf.CloudControllerSpace, cf.CloudControllerOrganization, error)
}
type SpaceGUID ¶
type SpaceGUID string
func (SpaceGUID) BelongsToOrganization ¶
func (SpaceGUID) BelongsToSpace ¶
func (SpaceGUID) IsTypeEmail ¶
type SpaceRecipe ¶
type SpaceRecipe struct {
// contains filtered or unexported fields
}
func NewSpaceRecipe ¶
func NewSpaceRecipe(tokenLoader TokenLoaderInterface, userLoader UserLoaderInterface, spaceAndOrgLoader SpaceAndOrgLoaderInterface, templatesLoader TemplatesLoaderInterface, mailer MailerInterface, receiptsRepo models.ReceiptsRepoInterface) SpaceRecipe
func (SpaceRecipe) Dispatch ¶
func (recipe SpaceRecipe) Dispatch(clientID string, guid TypedGUID, options Options, conn models.ConnectionInterface) ([]Response, error)
func (SpaceRecipe) Trim ¶
func (recipe SpaceRecipe) Trim(responses []byte) []byte
type TemplateLoadError ¶
type TemplateLoadError string
func (TemplateLoadError) Error ¶
func (err TemplateLoadError) Error() string
type TemplatesLoader ¶
type TemplatesLoader struct {
// contains filtered or unexported fields
}
func NewTemplatesLoader ¶
func NewTemplatesLoader(finder services.TemplateFinderInterface) TemplatesLoader
func (TemplatesLoader) LoadTemplates ¶
func (loader TemplatesLoader) LoadTemplates(subjectSuffix, contentSuffix, client, kind string) (Templates, error)
type TokenLoader ¶
type TokenLoader struct {
// contains filtered or unexported fields
}
func NewTokenLoader ¶
func NewTokenLoader(uaaClient UAAInterface) TokenLoader
func (TokenLoader) Load ¶
func (loader TokenLoader) Load() (string, error)
type TokenLoaderInterface ¶
type UAADownError ¶
type UAADownError string
func (UAADownError) Error ¶
func (err UAADownError) Error() string
type UAAGenericError ¶
type UAAGenericError string
func (UAAGenericError) Error ¶
func (err UAAGenericError) Error() string
type UAAInterface ¶
type UAAInterface interface {
uaa.GetClientTokenInterface
uaa.SetTokenInterface
uaa.UsersEmailsByIDsInterface
}
type UAAScopesError ¶
type UAAScopesError string
func (UAAScopesError) Error ¶
func (err UAAScopesError) Error() string
type UAAUserNotFoundError ¶
type UAAUserNotFoundError string
func (UAAUserNotFoundError) Error ¶
func (err UAAUserNotFoundError) Error() string
type UserGUID ¶
type UserGUID string
func NewUserGUID ¶
func NewUserGUID() UserGUID
func (UserGUID) BelongsToOrganization ¶
func (UserGUID) BelongsToSpace ¶
func (UserGUID) IsTypeEmail ¶
type UserLoader ¶
type UserLoader struct {
// contains filtered or unexported fields
}
func NewUserLoader ¶
func NewUserLoader(uaaClient UAAInterface, logger *log.Logger, cloudController cf.CloudControllerInterface) UserLoader
type UserLoaderInterface ¶
type UserRecipe ¶
type UserRecipe struct {
// contains filtered or unexported fields
}
func NewUserRecipe ¶
func NewUserRecipe(tokenLoader TokenLoaderInterface, userLoader UserLoaderInterface, templatesLoader TemplatesLoaderInterface, mailer MailerInterface, receiptsRepo models.ReceiptsRepoInterface) UserRecipe
func (UserRecipe) Dispatch ¶
func (recipe UserRecipe) Dispatch(clientID string, guid TypedGUID, options Options, conn models.ConnectionInterface) ([]Response, error)
func (UserRecipe) Trim ¶
func (recipe UserRecipe) Trim(responses []byte) []byte
Click to show internal directories.
Click to hide internal directories.