Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Events = []Event{ {Name: "reception", Type: "message.reception"}, {Name: "delivered", Type: "message.delivered"}, {Name: "transient_error", Type: "message.transient_error"}, {Name: "failed", Type: "message.failed"}, {Name: "bounced", Type: "message.bounced"}, {Name: "suppressed", Type: "message.suppressed"}, {Name: "opened", Type: "message.opened"}, {Name: "clicked", Type: "message.clicked"}, {Name: "unsubscribed", Type: "message.unsubscribed"}, {Name: "complained", Type: "message.complained"}, {Name: "suppression_created", Type: "suppression.created"}, {Name: "suppression_deleted", Type: "suppression.deleted"}, {Name: "dns_error", Type: "domain.dns_error"}, {Name: "contact_created", Type: "contact.created", Contact: true}, {Name: "contact_updated", Type: "contact.updated", Contact: true}, {Name: "contact_deleted", Type: "contact.deleted", Contact: true}, {Name: "contact_added_to_list", Type: "contact.added_to_list", Contact: true}, {Name: "contact_removed_from_list", Type: "contact.removed_from_list", Contact: true}, {Name: "contact_subscribed", Type: "contact.subscribed", Contact: true}, {Name: "contact_unsubscribed", Type: "contact.unsubscribed", Contact: true}, {Name: "contact_complained", Type: "contact.complained", Contact: true}, }
Events lists every webhook event type, in the order the CLI shows them.
Functions ¶
func EventNames ¶ added in v0.3.0
EventNames returns the Name of each event, or nil when there are none.
func EventTypes ¶ added in v0.3.0
EventTypes returns the Type of each event, or nil when there are none.
func EventValues ¶ added in v0.3.0
func EventValues() []string
EventValues returns the values --events takes: the Name of each event, then its Type.
func GenerateMsgID ¶
func GenerateMsgID() string
func GenerateWebhookSecret ¶
GenerateWebhookSecret returns a new secret for signing webhooks: "aha-whsec-" and 64 random letters and digits.
Types ¶
type Event ¶ added in v0.3.0
type Event struct {
Name string
Type string
// Contact marks a contact event, which the API allows only for an
// account with the marketing features and an API key with the contact
// read scopes.
Contact bool
}
Event is a webhook event type. A webhook's settings name it by Name, as the API's on_<name> fields do; event payloads, the trigger endpoint and the listen filter name it by Type.
func FindEvent ¶ added in v0.3.0
FindEvent returns the event value names by its Name or its Type, in any case.
func ParseEvents ¶ added in v0.3.0
ParseEvents returns the event each value names, by its Name or its Type in any case, in the order given. Values that name no event, which the error names before it lists the events, and a value that names an event an earlier value named, are validation errors of the --events flag.
func SelectEvents ¶ added in v0.4.0
SelectEvents returns the events the event flags select: events, the ones --events named, then, in the order of Events, every event but the contact events when all is set, and every contact event when allContact is set.