Documentation
¶
Index ¶
- Constants
- func CCErrorFor(err error) error
- type AllUsers
- type CCDownError
- type CCNotFoundError
- type ClientMap
- type ClientMissingError
- type ClientsMap
- type ClientsRepo
- type ConnectionInterface
- type CriticalKindError
- type DatabaseInterface
- type DefaultScopeError
- type Delivery
- type Dispatch
- type DispatchClient
- type DispatchKind
- type DispatchMessage
- type DispatchVCAPRequest
- type EmailStrategy
- type Enqueuer
- type EveryoneStrategy
- type FindsUserIDs
- type GlobalUnsubscribesRepo
- type HTML
- type Kind
- type KindMissingError
- type KindsRepo
- type Message
- type MessageFinder
- type MissingKindOrClientError
- type NotificationsFinder
- type NotificationsUpdater
- type Options
- type OrganizationLoader
- type OrganizationStrategy
- type PreferenceUpdater
- type PreferencesBuilder
- type PreferencesFinder
- type PreferencesRepo
- type Registrar
- type Response
- type SpaceLoader
- type SpaceStrategy
- type TemplateFinder
- type TemplateLister
- type TemplateSummary
- type TemplateUpdater
- type TemplatesRepo
- type UAAScopeStrategy
- type UnsubscribesRepo
- type User
- type UserStrategy
Constants ¶
View Source
const ( OrganizationEndorsement = `You received this message because you belong to the "{{.Organization}}" organization.` OrganizationRoleEndorsement = `You received this message because you are an {{.OrganizationRole}} in the "{{.Organization}}" organization.` )
View Source
const EmailEndorsement = "This message was sent directly to your email address."
View Source
const EveryoneEndorsement = "This message was sent to everyone."
View Source
const ScopeEndorsement = "You received this message because you have the {{.Scope}} scope."
View Source
const SpaceEndorsement = `You received this message because you belong to the "{{.Space}}" space in the "{{.Organization}}" organization.`
View Source
const StatusQueued = "queued"
View Source
const UserEndorsement = "This message was sent directly to you."
Variables ¶
This section is empty.
Functions ¶
func CCErrorFor ¶
Types ¶
type AllUsers ¶
type AllUsers struct {
// contains filtered or unexported fields
}
func NewAllUsers ¶
func NewAllUsers(uaa uaaAllUsers) AllUsers
type CCDownError ¶
type CCDownError struct {
Err error
}
func (CCDownError) Error ¶
func (e CCDownError) Error() string
type CCNotFoundError ¶
type CCNotFoundError struct {
Err error
}
func (CCNotFoundError) Error ¶
func (e CCNotFoundError) Error() string
type ClientMissingError ¶
type ClientMissingError struct {
Err error
}
func (ClientMissingError) Error ¶
func (e ClientMissingError) Error() string
type ClientsMap ¶
type ClientsRepo ¶
type ClientsRepo interface { Find(connection models.ConnectionInterface, clientID string) (models.Client, error) FindAll(connection models.ConnectionInterface) ([]models.Client, error) FindAllByTemplateID(connection models.ConnectionInterface, templateID string) ([]models.Client, error) Update(connection models.ConnectionInterface, client models.Client) (models.Client, error) Upsert(connection models.ConnectionInterface, client models.Client) (models.Client, error) }
type ConnectionInterface ¶
type ConnectionInterface interface { models.ConnectionInterface }
type CriticalKindError ¶
type CriticalKindError struct {
Err error
}
func (CriticalKindError) Error ¶
func (e CriticalKindError) Error() string
type DatabaseInterface ¶
type DatabaseInterface interface { models.DatabaseInterface }
type DefaultScopeError ¶
type DefaultScopeError struct{}
func (DefaultScopeError) Error ¶
func (d DefaultScopeError) Error() string
type Dispatch ¶
type Dispatch struct { JobType string GUID string Role string Connection ConnectionInterface UAAHost string TemplateID string CampaignID string VCAPRequest DispatchVCAPRequest Message DispatchMessage Kind DispatchKind Client DispatchClient }
type DispatchClient ¶
type DispatchKind ¶
type DispatchMessage ¶
type DispatchVCAPRequest ¶
type EmailStrategy ¶
type EmailStrategy struct {
// contains filtered or unexported fields
}
func NewEmailStrategy ¶
func NewEmailStrategy(enqueuer enqueuer) EmailStrategy
type Enqueuer ¶
type Enqueuer struct {
// contains filtered or unexported fields
}
func NewEnqueuer ¶
func NewEnqueuer(queue queueInterface, messagesRepo messagesRepoUpserter, gobbleInitializer gobbleInitializer) Enqueuer
func (Enqueuer) Enqueue ¶
func (enqueuer Enqueuer) Enqueue( conn ConnectionInterface, users []User, options Options, space cf.CloudControllerSpace, organization cf.CloudControllerOrganization, clientID, uaaHost, scope, vcapRequestID string, reqReceived time.Time) ([]Response, error)
type EveryoneStrategy ¶
type EveryoneStrategy struct {
// contains filtered or unexported fields
}
func NewEveryoneStrategy ¶
func NewEveryoneStrategy(tokenLoader loadsTokens, allUsers allUserGUIDsGetter, enqueuer enqueuer) EveryoneStrategy
type FindsUserIDs ¶
type FindsUserIDs struct {
// contains filtered or unexported fields
}
func NewFindsUserIDs ¶
func NewFindsUserIDs(cc cloudController, uaa uaaUsersGUIDsByScope) FindsUserIDs
func (FindsUserIDs) UserIDsBelongingToOrganization ¶
func (finder FindsUserIDs) UserIDsBelongingToOrganization(orgGUID, role, token string) ([]string, error)
func (FindsUserIDs) UserIDsBelongingToScope ¶
func (finder FindsUserIDs) UserIDsBelongingToScope(token, scope string) ([]string, error)
func (FindsUserIDs) UserIDsBelongingToSpace ¶
func (finder FindsUserIDs) UserIDsBelongingToSpace(spaceGUID, token string) ([]string, error)
type GlobalUnsubscribesRepo ¶
type GlobalUnsubscribesRepo interface { Get(connection models.ConnectionInterface, userGUID string) (bool, error) Set(connection models.ConnectionInterface, userGUID string, unsubscribe bool) error }
type KindMissingError ¶
type KindMissingError struct {
Err error
}
func (KindMissingError) Error ¶
func (e KindMissingError) Error() string
type KindsRepo ¶
type KindsRepo interface { Find(connection models.ConnectionInterface, kindID string, clientID string) (models.Kind, error) FindAll(connection models.ConnectionInterface) ([]models.Kind, error) FindAllByTemplateID(connection models.ConnectionInterface, templateID string) ([]models.Kind, error) Trim(connection models.ConnectionInterface, clientID string, kindIDs []string) (int, error) Update(connection models.ConnectionInterface, kind models.Kind) (models.Kind, error) Upsert(connection models.ConnectionInterface, kind models.Kind) (models.Kind, error) }
type MessageFinder ¶
type MessageFinder struct {
// contains filtered or unexported fields
}
func NewMessageFinder ¶
func NewMessageFinder(repo messagesRepoFinder) MessageFinder
func (MessageFinder) Find ¶
func (finder MessageFinder) Find(database DatabaseInterface, messageID string) (Message, error)
type MissingKindOrClientError ¶
type MissingKindOrClientError struct {
Err error
}
func (MissingKindOrClientError) Error ¶
func (e MissingKindOrClientError) Error() string
type NotificationsFinder ¶
type NotificationsFinder struct {
// contains filtered or unexported fields
}
func NewNotificationsFinder ¶
func NewNotificationsFinder(clientsRepo ClientsRepo, kindsRepo KindsRepo) NotificationsFinder
func (NotificationsFinder) AllClientsAndNotifications ¶
func (finder NotificationsFinder) AllClientsAndNotifications(database DatabaseInterface) ([]models.Client, []models.Kind, error)
func (NotificationsFinder) ClientAndKind ¶
func (finder NotificationsFinder) ClientAndKind(database DatabaseInterface, clientID, kindID string) (models.Client, models.Kind, error)
type NotificationsUpdater ¶
type NotificationsUpdater struct {
// contains filtered or unexported fields
}
func NewNotificationsUpdater ¶
func NewNotificationsUpdater(kindsRepo KindsRepo) NotificationsUpdater
func (NotificationsUpdater) Update ¶
func (updater NotificationsUpdater) Update(database DatabaseInterface, notification models.Kind) error
type OrganizationLoader ¶
type OrganizationLoader struct {
// contains filtered or unexported fields
}
func NewOrganizationLoader ¶
func NewOrganizationLoader(cc cloudController) OrganizationLoader
func (OrganizationLoader) Load ¶
func (loader OrganizationLoader) Load(orgGUID string, token string) (cf.CloudControllerOrganization, error)
type OrganizationStrategy ¶
type OrganizationStrategy struct {
// contains filtered or unexported fields
}
func NewOrganizationStrategy ¶
func NewOrganizationStrategy(tokenLoader loadsTokens, organizationLoader loadsOrganizations, findsUserIDs orgUserIDFinder, queue enqueuer) OrganizationStrategy
type PreferenceUpdater ¶
type PreferenceUpdater struct {
// contains filtered or unexported fields
}
func NewPreferenceUpdater ¶
func NewPreferenceUpdater(globalUnsubscribesRepo GlobalUnsubscribesRepo, unsubscribesRepo UnsubscribesRepo, kindsRepo KindsRepo) PreferenceUpdater
func (PreferenceUpdater) Update ¶
func (updater PreferenceUpdater) Update(conn ConnectionInterface, preferences []models.Preference, globalUnsubscribe bool, userID string) error
type PreferencesBuilder ¶
type PreferencesBuilder struct { GlobalUnsubscribe bool `json:"global_unsubscribe"` Clients ClientsMap `json:"clients"` }
func NewPreferencesBuilder ¶
func NewPreferencesBuilder() PreferencesBuilder
func (PreferencesBuilder) Add ¶
func (pref PreferencesBuilder) Add(preference models.Preference)
func (PreferencesBuilder) ToPreferences ¶
func (pref PreferencesBuilder) ToPreferences() ([]models.Preference, error)
type PreferencesFinder ¶
type PreferencesFinder struct {
// contains filtered or unexported fields
}
func NewPreferencesFinder ¶
func NewPreferencesFinder(preferencesRepo PreferencesRepo, globalUnsubscribesRepo GlobalUnsubscribesRepo) *PreferencesFinder
func (PreferencesFinder) Find ¶
func (finder PreferencesFinder) Find(database DatabaseInterface, userGUID string) (PreferencesBuilder, error)
type PreferencesRepo ¶
type PreferencesRepo interface {
FindNonCriticalPreferences(connection models.ConnectionInterface, userGUID string) ([]models.Preference, error)
}
type Registrar ¶
type Registrar struct {
// contains filtered or unexported fields
}
func NewRegistrar ¶
func NewRegistrar(clientsRepo ClientsRepo, kindsRepo KindsRepo) Registrar
type SpaceLoader ¶
type SpaceLoader struct {
// contains filtered or unexported fields
}
func NewSpaceLoader ¶
func NewSpaceLoader(cc cloudController) SpaceLoader
func (SpaceLoader) Load ¶
func (loader SpaceLoader) Load(spaceGUID string, token string) (cf.CloudControllerSpace, error)
type SpaceStrategy ¶
type SpaceStrategy struct {
// contains filtered or unexported fields
}
func NewSpaceStrategy ¶
func NewSpaceStrategy(tokenLoader loadsTokens, spaceLoader loadsSpaces, organizationLoader loadsOrganizations, findsUserIDs spaceUserIDFinder, enqueuer enqueuer) SpaceStrategy
type TemplateFinder ¶
type TemplateFinder struct {
// contains filtered or unexported fields
}
func NewTemplateFinder ¶
func NewTemplateFinder(templatesRepo TemplatesRepo) TemplateFinder
func (TemplateFinder) FindByID ¶
func (finder TemplateFinder) FindByID(database DatabaseInterface, templateID string) (models.Template, error)
type TemplateLister ¶
type TemplateLister struct {
// contains filtered or unexported fields
}
func NewTemplateLister ¶
func NewTemplateLister(templatesRepo TemplatesRepo) TemplateLister
func (TemplateLister) List ¶
func (lister TemplateLister) List(database DatabaseInterface) (map[string]TemplateSummary, error)
type TemplateSummary ¶
type TemplateSummary struct {
Name string `json:"name"`
}
type TemplateUpdater ¶
type TemplateUpdater struct {
// contains filtered or unexported fields
}
func NewTemplateUpdater ¶
func NewTemplateUpdater(templatesRepo TemplatesRepo) TemplateUpdater
func (TemplateUpdater) Update ¶
func (updater TemplateUpdater) Update(database DatabaseInterface, templateID string, template models.Template) error
type TemplatesRepo ¶
type TemplatesRepo interface { Create(connection models.ConnectionInterface, template models.Template) (models.Template, error) Destroy(connection models.ConnectionInterface, templateID string) error FindByID(connection models.ConnectionInterface, templateID string) (models.Template, error) ListIDsAndNames(connection models.ConnectionInterface) ([]models.Template, error) Update(connection models.ConnectionInterface, templateID string, template models.Template) (models.Template, error) }
type UAAScopeStrategy ¶
type UAAScopeStrategy struct {
// contains filtered or unexported fields
}
func NewUAAScopeStrategy ¶
func NewUAAScopeStrategy(tokenLoader loadsTokens, findsUserIDs scopeUserIDFinder, enqueuer enqueuer, defaultScopes []string) UAAScopeStrategy
type UnsubscribesRepo ¶
type UserStrategy ¶
type UserStrategy struct {
// contains filtered or unexported fields
}
func NewUserStrategy ¶
func NewUserStrategy(enqueuer enqueuer) UserStrategy
Source Files
¶
- all_users.go
- database.go
- dispatch.go
- email_strategy.go
- enqueuer.go
- errors.go
- everyone_strategy.go
- finds_user_ids.go
- message_finder.go
- notifications_finder.go
- notifications_updater.go
- organization_loader.go
- organization_strategy.go
- preference_updater.go
- preferences_builder.go
- preferences_finder.go
- registrar.go
- repos.go
- response.go
- space_loader.go
- space_strategy.go
- template_finder.go
- template_lister.go
- template_updater.go
- uaa_scope_strategy.go
- user.go
- user_strategy.go
Click to show internal directories.
Click to hide internal directories.