Documentation
¶
Index ¶
- Variables
- type Config
- type Delivery
- func (d *Delivery) CheckInvalidContent(c notification.Content) ([]string, error)
- func (d *Delivery) ContentFields() []*notificationdelivery.Field
- func (d *Delivery) Deliver(c notification.Content) (status notificationdelivery.DeliveryStatus, receipt string, err error)
- func (d *Delivery) DeliveryType() string
- func (d *Delivery) MustEscape(u string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var DeliveryType = "noitificationapi"
View Source
var Factory = func(loader func(interface{}) error) (notificationdelivery.DeliveryDriver, error) { c := &Config{} err := loader(c) if err != nil { return nil, err } p, err := c.Server.CreatePreset() if err != nil { return nil, err } d := &Delivery{ Preset: p.With(fetcher.Method("POST")), RequiredContent: c.RequiredContent, Type: c.DeliveryType, Fields: c.Fields, } if d.Type == "" { d.Type = DeliveryType } return d, nil }
Functions ¶
This section is empty.
Types ¶
type Delivery ¶
type Delivery struct { Preset *fetcher.Preset Type string Fields []*notificationdelivery.Field RequiredContent []string }
func (*Delivery) CheckInvalidContent ¶
func (d *Delivery) CheckInvalidContent(c notification.Content) ([]string, error)
CheckInvalidContent check if given content invalid Return invalid fields and any error raised
func (*Delivery) ContentFields ¶
func (d *Delivery) ContentFields() []*notificationdelivery.Field
ContentFields return content fields Return invalid fields and any error raised
func (*Delivery) Deliver ¶
func (d *Delivery) Deliver(c notification.Content) (status notificationdelivery.DeliveryStatus, receipt string, err error)
Deliver send give content. Return delivery status and any receipt if returned,and any error if raised.
func (*Delivery) MustEscape ¶
MustEscape delivery escape helper
Click to show internal directories.
Click to hide internal directories.