Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWebhook ¶
func NewWebhook(url, key, defaultProject string) *webhookService
Types ¶
type CreateEndpointResponse ¶
type Endpoint ¶
type Endpoint struct { Message string `json:"message"` Status bool `json:"status"` Data EndpointData `json:"data"` }
type EndpointData ¶
type EndpointData struct { // Authentication // Secrets SlackWebhookURL string `json:"slack_webhook_url"` Status string `json:"status"` SupportEmail string `json:"support_email"` UID string `json:"uid"` UpdatedAt time.Time `json:"updated_at"` URL string `json:"url"` CreatedAt time.Time `json:"created_at"` DeletedAt *time.Time `json:"deleted_at"` Description string `json:"description"` Events int64 `json:"events"` HttpTimeout int64 `json:"http_timeout"` Name string `json:"name"` OwnerID string `json:"owner_id"` ProjectID string `json:"project_id"` RateLimit int64 `json:"rate_limit"` RateLimitDuration int64 `json:"rate_limit_duration"` }
type EndpointResponse ¶
type EndpointToggleStatus ¶
type EndpointToggleStatus struct { Data struct { Status string `json:"status"` } `json:"data"` }
type EventDelivery ¶ added in v0.1.4
type EventDelivery struct { Message string `json:"message"` Status bool `json:"status"` Data struct { Content []EventDeliveryContent `json:"content"` } `json:"data"` }
type EventDeliveryContent ¶ added in v0.1.4
type EventDeliveryContent struct { CreatedAt time.Time `json:"created_at"` // EventID string `json:"event_id"` Status string `json:"status"` EventMetadata struct { EventType string `json:"event_type"` } `json:"event_metadata"` Metadata struct { NumTrials int64 `json:"num_trials"` RetryLimit int64 `json:"retry_limit"` } `json:"metadata"` }
type UpsertEndpointParams ¶
type UpsertEndpointParams struct { Name string `json:"name"` URL string `json:"url"` AdvancedSignatures bool `json:"advanced_signatures"` AppID string `json:"appID"` // deprecated but required // Authentication Description string `json:"description"` HttpTimeout int64 `json:"http_timeout"` IsDisabled bool `json:"is_disabled"` OwnerID string `json:"owner_id"` RateLimit int64 `json:"rate_limit"` RateLimitDuration int64 `json:"rate_limit_duration"` Secret string `json:"secret"` SlackWebhookURL string `json:"slack_webhook_url"` SupportEmail string `json:"support_email"` }
type Webhook ¶
type Webhook struct { Data WebhookData Headers map[string][]string }
type WebhookData ¶
type WebhookInterface ¶
type WebhookInterface interface { GetEndpoint(projectID, endpointID string) (*Endpoint, error) CreateEndpoint(projectID string, params UpsertEndpointParams) (*CreateEndpointResponse, error) UpdateEndpoint(projectID, endpointID string, params UpsertEndpointParams) (*EndpointResponse, error) DeleteEndpoint(projectID, endpointID string) (*EndpointResponse, error) TogglePause(projectID, endpointID string) (string, error) CreateEvent(projectID string, webhookData *Webhook) error GetEndpointEventDeliveries(projectID, endpointID string, itemsPerPage int64) (*EventDelivery, error) }
Click to show internal directories.
Click to hide internal directories.