Documentation ¶
Index ¶
- Variables
- type Config
- type Delivery
- func (d *Delivery) CheckInvalidContent(notification.Content) ([]string, error)
- func (d Delivery) ContentFields() []*notificationdelivery.Field
- func (d *Delivery) Deliver(c notification.Content) (notificationdelivery.DeliveryStatus, string, error)
- func (d *Delivery) DeliveryType() string
- func (d *Delivery) MustEscape(unescaped string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var DeliveryType = "mock"
View Source
var Factory = func(loader func(interface{}) error) (notificationdelivery.DeliveryDriver, error) { c := &Config{} err := loader(c) if err != nil { return nil, err } l := logger.GetBuiltinLogger(c.Logger) if l == nil { return nil, fmt.Errorf("builtin logger [%s] not found", c.Logger) } d := &Delivery{ logger: l, failPercent: c.FailPercent, errorPercent: c.ErrorPercent, } if c.DelayMinDuration != "" { dmin, err := time.ParseDuration(c.DelayMinDuration) if err != nil { return nil, err } d.delayMin = dmin } if c.DelayMaxDuration != "" { dmax, err := time.ParseDuration(c.DelayMaxDuration) if err != nil { return nil, err } d.delayMax = dmax } if d.delayMax < d.delayMin { d.delayMax = d.delayMin } return d, nil }
Functions ¶
This section is empty.
Types ¶
type Delivery ¶
type Delivery struct {
// contains filtered or unexported fields
}
func (*Delivery) CheckInvalidContent ¶
func (d *Delivery) CheckInvalidContent(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) (notificationdelivery.DeliveryStatus, string, error)
func (*Delivery) DeliveryType ¶
func (*Delivery) MustEscape ¶
Click to show internal directories.
Click to hide internal directories.