Documentation ¶
Overview ¶
Package webhook provides the support for reading and parsing the events sent from DNSimple via webhook.
Index ¶
- type Account
- type AccountEventData
- type AccountMembershipEventData
- type Actor
- type CertificateEventData
- type ContactEventData
- type DNSSECEventData
- type DomainEventData
- type DomainRegistrantChangeEventData
- type DomainTransferLockEventData
- type EmailForwardEventData
- type Event
- type EventDataContainer
- type GenericEventData
- type WebhookEventData
- type WhoisPrivacyEventData
- type ZoneEventData
- type ZoneRecordEventData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { dnsimple.Account // Display is a string that can be used as a display label // and it is sent in a webhook payload // It generally represent the name of the account. Display string `json:"display,omitempty"` // Identifier is a human-readable string identifier // and it is sent in a webhook payload // It generally represent the StringID or email of the account. Identifier string `json:"identifier,omitempty"` }
Account represents the account that this event is attached to.
type AccountEventData ¶ added in v0.30.0
AccountEventData represents the data node for an Account event.
type AccountMembershipEventData ¶ added in v0.63.0
type AccountMembershipEventData struct { Account *dnsimple.Account `json:"account"` AccountInvitation *dnsimple.AccountInvitation `json:"account_invitation"` User *dnsimple.User `json:"user"` }
AccountMembershipEventData represents the data node for an Account event.
type Actor ¶
type Actor struct { ID string `json:"id"` Entity string `json:"entity"` Pretty string `json:"pretty"` }
Actor represents the entity that triggered the event. It can be either an user, a DNSimple support representative or the DNSimple system.
type CertificateEventData ¶ added in v0.30.0
type CertificateEventData struct {
Certificate *dnsimple.Certificate `json:"certificate"`
}
CertificateEventData represents the data node for a Certificate event.
type ContactEventData ¶ added in v0.30.0
ContactEventData represents the data node for a Contact event.
type DNSSECEventData ¶ added in v0.30.0
type DNSSECEventData struct {
DelegationSignerRecord *dnsimple.DelegationSignerRecord `json:"delegation_signer_record"`
}
DNSSECEventData represents the data node for a DNSSEC event.
type DomainEventData ¶ added in v0.30.0
type DomainEventData struct { Auto bool `json:"auto"` Domain *dnsimple.Domain `json:"domain"` Registrant *dnsimple.Contact `json:"registrant"` Delegation *dnsimple.Delegation `json:"name_servers"` }
DomainEventData represents the data node for a Domain event.
type DomainRegistrantChangeEventData ¶ added in v1.4.1
type DomainRegistrantChangeEventData struct { Domain *dnsimple.Domain `json:"domain"` Registrant *dnsimple.Contact `json:"registrant"` }
DomainRegistrantChangegEventData represents the data node for a DomainRegistrantChange event.
type DomainTransferLockEventData ¶ added in v1.4.1
DomainTransferLockEventData represents the data node for a DomainTransferLockEnable or DomainTransferLockDisable event.
type EmailForwardEventData ¶ added in v0.30.0
type EmailForwardEventData struct {
EmailForward *dnsimple.EmailForward `json:"email_forward"`
}
EmailForwardEventData represents the data node for a EmailForward event.
type Event ¶
type Event struct { APIVersion string `json:"api_version"` RequestID string `json:"request_identifier"` Name string `json:"name"` Actor *Actor `json:"actor"` Account *Account `json:"account"` // contains filtered or unexported fields }
Event represents a webhook event.
func ParseEvent ¶ added in v0.30.0
ParseEvent takes an event payload and attempts to deserialize the payload into an Event.
The event data will be set with a data type that matches the event action in the payload. If no direct match is found, then a GenericEventData is assigned.
The event data type is an EventContainerData interface. Therefore, you must perform typecasting to access any type-specific field.
func (*Event) GetData ¶ added in v0.30.0
func (e *Event) GetData() EventDataContainer
GetData returns the data container for the specific event type.
func (*Event) GetPayload ¶ added in v0.20.0
GetPayload returns the data payload.
type EventDataContainer ¶ added in v0.30.0
type EventDataContainer interface {
// contains filtered or unexported methods
}
EventDataContainer defines the container for the event payload data.
type GenericEventData ¶ added in v0.30.0
type GenericEventData map[string]interface{}
GenericEventData represents the data node for a generic event, where the data is a simple map of strings.
type WebhookEventData ¶ added in v0.30.0
WebhookEventData represents the data node for a Webhook event.
type WhoisPrivacyEventData ¶ added in v0.30.0
type WhoisPrivacyEventData struct { Domain *dnsimple.Domain `json:"domain"` WhoisPrivacy *dnsimple.WhoisPrivacy `json:"whois_privacy"` }
WhoisPrivacyEventData represents the data node for a WhoisPrivacy event.
type ZoneEventData ¶ added in v0.30.0
ZoneEventData represents the data node for a Zone event.
type ZoneRecordEventData ¶ added in v0.30.0
type ZoneRecordEventData struct {
ZoneRecord *dnsimple.ZoneRecord `json:"zone_record"`
}
ZoneRecordEventData represents the data node for a ZoneRecord event.