Documentation ¶
Index ¶
- Constants
- type FeatureNotification
- func (n *FeatureNotification) ActivateMail()
- func (n *FeatureNotification) ChangeValue(cfv features.ChangeableFeatureValue)
- func (n *FeatureNotification) GetDescription() Fields
- func (n *FeatureNotification) GetID() string
- func (n *FeatureNotification) GetNotificationSubject() string
- func (n *FeatureNotification) GetValue(f Field) (*features.ChangeableFeatureValue, bool)
- func (n *FeatureNotification) MarshalBinary() ([]byte, error)
- func (n *FeatureNotification) SendNotificationMail()
- func (n *FeatureNotification) SendWelcomeMail()
- func (n *FeatureNotification) UnmarshalBinary(data []byte) error
- type Field
- type FieldNotification
- func (n *FieldNotification) ActivateMail()
- func (n *FieldNotification) ChangeValue(cfv features.ChangeableFeatureValue)
- func (n *FieldNotification) GetDescription() Fields
- func (n *FieldNotification) GetID() string
- func (n *FieldNotification) GetNotificationSubject() string
- func (n *FieldNotification) GetValue(f Field) (*features.ChangeableFeatureValue, bool)
- func (n *FieldNotification) MarshalBinary() ([]byte, error)
- func (n *FieldNotification) SendNotificationMail()
- func (n *FieldNotification) SendWelcomeMail()
- func (n *FieldNotification) UnmarshalBinary(data []byte) error
- type Fields
- type INotification
- type NotificationPostData
- type ProviderNotification
- func (n *ProviderNotification) ActivateMail()
- func (n *ProviderNotification) ChangeValue(cfv features.ChangeableFeatureValue)
- func (n *ProviderNotification) GetDescription() Fields
- func (n *ProviderNotification) GetID() string
- func (n *ProviderNotification) GetNotificationSubject() string
- func (n *ProviderNotification) GetValue(f Field) (*features.ChangeableFeatureValue, bool)
- func (n *ProviderNotification) MarshalBinary() ([]byte, error)
- func (n *ProviderNotification) SendNotificationMail()
- func (n *ProviderNotification) SendWelcomeMail()
- func (n *ProviderNotification) UnmarshalBinary(data []byte) error
Constants ¶
const ( NotificationTypeProvider = 'P' NotificationTypeFeature = 'F' NotificationTypeField = 'f' )
NotificationType strings
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FeatureNotification ¶
type FeatureNotification struct { Notification *notification Description Fields Values features.ChangeableFeatureValueS }
FeatureNotification is a notifier for certain features. It implements INotification
func NewFeatureNotification ¶
func NewFeatureNotification(features []string, mail string, values features.ChangeableFeatureValueS, html bool) (fn *FeatureNotification, ma *mailactivation.MailActivation, err error)
NewFeatureNotification creates a new FeatureNotification
func (*FeatureNotification) ActivateMail ¶
func (n *FeatureNotification) ActivateMail()
ActivateMail activates the mail for this notification
func (*FeatureNotification) ChangeValue ¶
func (n *FeatureNotification) ChangeValue(cfv features.ChangeableFeatureValue)
ChangeValue changes a value to update the Last and Current properties
func (*FeatureNotification) GetDescription ¶
func (n *FeatureNotification) GetDescription() Fields
GetDescription returns the feature names for this notification
func (*FeatureNotification) GetID ¶
func (n *FeatureNotification) GetID() string
GetID returns the notification id
func (*FeatureNotification) GetNotificationSubject ¶
func (n *FeatureNotification) GetNotificationSubject() string
GetNotificationSubject returns the subject of the notification email
func (*FeatureNotification) GetValue ¶
func (n *FeatureNotification) GetValue(f Field) (*features.ChangeableFeatureValue, bool)
GetValue returns the Value for the specified Field
func (*FeatureNotification) MarshalBinary ¶
func (n *FeatureNotification) MarshalBinary() ([]byte, error)
MarshalBinary marshals FeatureNotification into bytes
func (*FeatureNotification) SendNotificationMail ¶
func (n *FeatureNotification) SendNotificationMail()
SendNotificationMail sends a notification mail
func (*FeatureNotification) SendWelcomeMail ¶
func (n *FeatureNotification) SendWelcomeMail()
SendWelcomeMail sends a welcome mail
func (*FeatureNotification) UnmarshalBinary ¶
func (n *FeatureNotification) UnmarshalBinary(data []byte) error
UnmarshalBinary unmarshalls bytes into FeatureNotification.
type FieldNotification ¶
type FieldNotification struct { Notification *notification Description Fields Values features.ChangeableFeatureValueS }
FieldNotification is a notifier for certain fields. It implements INotification
func NewFieldNotification ¶
func NewFieldNotification(fields Fields, mail string, values features.ChangeableFeatureValueS, html bool) (fn *FieldNotification, ma *mailactivation.MailActivation, err error)
NewFieldNotification creates a new FeatureNotification
func (*FieldNotification) ActivateMail ¶
func (n *FieldNotification) ActivateMail()
ActivateMail activates the mail for this notification
func (*FieldNotification) ChangeValue ¶
func (n *FieldNotification) ChangeValue(cfv features.ChangeableFeatureValue)
ChangeValue changes a value to update the Last and Current properties
func (*FieldNotification) GetDescription ¶
func (n *FieldNotification) GetDescription() Fields
GetDescription returns the field names for this notification
func (*FieldNotification) GetID ¶
func (n *FieldNotification) GetID() string
GetID returns the notification id
func (*FieldNotification) GetNotificationSubject ¶
func (n *FieldNotification) GetNotificationSubject() string
GetNotificationSubject returns the subject of the notification email
func (*FieldNotification) GetValue ¶
func (n *FieldNotification) GetValue(f Field) (*features.ChangeableFeatureValue, bool)
GetValue returns the Value for the specified Field
func (*FieldNotification) MarshalBinary ¶
func (n *FieldNotification) MarshalBinary() ([]byte, error)
MarshalBinary marshals FieldNotification into bytes
func (*FieldNotification) SendNotificationMail ¶
func (n *FieldNotification) SendNotificationMail()
SendNotificationMail sends a notification mail
func (*FieldNotification) SendWelcomeMail ¶
func (n *FieldNotification) SendWelcomeMail()
SendWelcomeMail sends a welcome mail
func (*FieldNotification) UnmarshalBinary ¶
func (n *FieldNotification) UnmarshalBinary(data []byte) error
UnmarshalBinary unmarshalls bytes into FieldNotification.
type Fields ¶
type Fields []Field
Fields is a slice of Field
func FeaturesToFields ¶
FeaturesToFields transforms a slice of features names into a slice of Fields
func ProvidersToFields ¶
ProvidersToFields transforms a slice of provider names into a slice of Fields
type INotification ¶
type INotification interface { GetID() string SendNotificationMail() SendWelcomeMail() GetNotificationSubject() string ChangeValue(features.ChangeableFeatureValue) GetValue(Field) (*features.ChangeableFeatureValue, bool) GetDescription() Fields ActivateMail() encoding.BinaryMarshaler encoding.BinaryUnmarshaler }
INotification is an interface for all notification types.
func GetNotificationTypeDummyFromID ¶
func GetNotificationTypeDummyFromID(id string) INotification
GetNotificationTypeDummyFromID creates a dummy notification with the correct type from an given id
type NotificationPostData ¶
type NotificationPostData struct { Email string `json:"email"` HTML bool `json:"html"` Type string `json:"type"` Providers []string `json:"providers"` Features []string `json:"features"` Fields Fields `json:"fields"` }
NotificationPostData holds the PostData for notifications
func (*NotificationPostData) MarshalBinary ¶
func (v *NotificationPostData) MarshalBinary() ([]byte, error)
MarshalBinary marshals NotificationPostData into bytes.
func (*NotificationPostData) UnmarshalBinary ¶
func (v *NotificationPostData) UnmarshalBinary(data []byte) error
UnmarshalBinary unmarshalls bytes into NotificationPostData.
func (*NotificationPostData) Validate ¶
func (v *NotificationPostData) Validate() error
Validate validates the given NotificationPostData
type ProviderNotification ¶
type ProviderNotification struct { Notification *notification Description Fields Values features.ChangeableFeatureValueS }
ProviderNotification is a notifier for certain providers. It implements INotification
func NewProviderNotification ¶
func NewProviderNotification(providers []string, mail string, values features.ChangeableFeatureValueS, html bool) (pn *ProviderNotification, ma *mailactivation.MailActivation, err error)
NewProviderNotification creates a new FeatureNotification
func (*ProviderNotification) ActivateMail ¶
func (n *ProviderNotification) ActivateMail()
ActivateMail activates the mail for this notification
func (*ProviderNotification) ChangeValue ¶
func (n *ProviderNotification) ChangeValue(cfv features.ChangeableFeatureValue)
ChangeValue changes a value to update the Last and Current properties
func (*ProviderNotification) GetDescription ¶
func (n *ProviderNotification) GetDescription() Fields
GetDescription returns the providers for this notification
func (*ProviderNotification) GetID ¶
func (n *ProviderNotification) GetID() string
GetID returns the notification id
func (*ProviderNotification) GetNotificationSubject ¶
func (n *ProviderNotification) GetNotificationSubject() string
GetNotificationSubject returns the subject of the notification email
func (*ProviderNotification) GetValue ¶
func (n *ProviderNotification) GetValue(f Field) (*features.ChangeableFeatureValue, bool)
GetValue returns the Value for the specified Field
func (*ProviderNotification) MarshalBinary ¶
func (n *ProviderNotification) MarshalBinary() ([]byte, error)
MarshalBinary marshals ProviderNotification into bytes
func (*ProviderNotification) SendNotificationMail ¶
func (n *ProviderNotification) SendNotificationMail()
SendNotificationMail sends a notification mail
func (*ProviderNotification) SendWelcomeMail ¶
func (n *ProviderNotification) SendWelcomeMail()
SendWelcomeMail sends a welcome mail
func (*ProviderNotification) UnmarshalBinary ¶
func (n *ProviderNotification) UnmarshalBinary(data []byte) error
UnmarshalBinary unmarshalls bytes into ProviderNotification.