Documentation
¶
Index ¶
- Constants
- func VerifySvixSignature(webhookID, webhookTimestamp, webhookSignature string, body []byte, ...) error
- type Client
- type Configuration
- type CreateIncident
- func (c *CreateIncident) Actions() []core.Action
- func (c *CreateIncident) Cancel(ctx core.ExecutionContext) error
- func (c *CreateIncident) Cleanup(ctx core.SetupContext) error
- func (c *CreateIncident) Color() string
- func (c *CreateIncident) Configuration() []configuration.Field
- func (c *CreateIncident) Description() string
- func (c *CreateIncident) Documentation() string
- func (c *CreateIncident) ExampleOutput() map[string]any
- func (c *CreateIncident) Execute(ctx core.ExecutionContext) error
- func (c *CreateIncident) HandleAction(ctx core.ActionContext) error
- func (c *CreateIncident) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (c *CreateIncident) Icon() string
- func (c *CreateIncident) Label() string
- func (c *CreateIncident) Name() string
- func (c *CreateIncident) OutputChannels(configuration any) []core.OutputChannel
- func (c *CreateIncident) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *CreateIncident) Setup(ctx core.SetupContext) error
- type CreateIncidentRequest
- type CreateIncidentResponse
- type CreateIncidentSpec
- type IncidentIO
- func (i *IncidentIO) Actions() []core.Action
- func (i *IncidentIO) Cleanup(ctx core.IntegrationCleanupContext) error
- func (i *IncidentIO) Components() []core.Component
- func (i *IncidentIO) Configuration() []configuration.Field
- func (i *IncidentIO) Description() string
- func (i *IncidentIO) HandleAction(ctx core.IntegrationActionContext) error
- func (i *IncidentIO) HandleRequest(ctx core.HTTPRequestContext)
- func (i *IncidentIO) Icon() string
- func (i *IncidentIO) Instructions() string
- func (i *IncidentIO) Label() string
- func (i *IncidentIO) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (i *IncidentIO) Name() string
- func (i *IncidentIO) Sync(ctx core.SyncContext) error
- func (i *IncidentIO) Triggers() []core.Trigger
- type IncidentIOWebhookHandler
- func (h *IncidentIOWebhookHandler) Cleanup(ctx core.WebhookHandlerContext) error
- func (h *IncidentIOWebhookHandler) CompareConfig(a, b any) (bool, error)
- func (h *IncidentIOWebhookHandler) Merge(current, requested any) (any, bool, error)
- func (h *IncidentIOWebhookHandler) Setup(ctx core.WebhookHandlerContext) (any, error)
- type IncidentStatusRef
- type IncidentV2
- type OnIncident
- func (t *OnIncident) Actions() []core.Action
- func (t *OnIncident) Cleanup(ctx core.TriggerContext) error
- func (t *OnIncident) Color() string
- func (t *OnIncident) Configuration() []configuration.Field
- func (t *OnIncident) Description() string
- func (t *OnIncident) Documentation() string
- func (t *OnIncident) ExampleData() map[string]any
- func (t *OnIncident) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)
- func (t *OnIncident) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
- func (t *OnIncident) Icon() string
- func (t *OnIncident) Label() string
- func (t *OnIncident) Name() string
- func (t *OnIncident) Setup(ctx core.TriggerContext) error
- type OnIncidentConfiguration
- type OnIncidentMetadata
- type Severity
- type SeverityListResponse
- type SeverityRef
- type WebhookConfiguration
- type WebhookMetadata
Constants ¶
const ( EventIncidentCreatedV2 = "public_incident.incident_created_v2" EventIncidentUpdatedV2 = "public_incident.incident_updated_v2" )
Event type names from incident.io webhook API (v2 public incident).
const BaseURL = "https://api.incident.io"
Variables ¶
This section is empty.
Functions ¶
func VerifySvixSignature ¶
func VerifySvixSignature(webhookID, webhookTimestamp, webhookSignature string, body []byte, secret []byte) error
VerifySvixSignature verifies the incident.io (Svix) webhook signature. Headers: webhook-id, webhook-timestamp, webhook-signature (incident.io uses webhook- prefix). Signed content: id + "." + timestamp + "." + raw_body Secret: if it has "whsec_" prefix, the key is the base64-decoded part after it; otherwise raw bytes.
Types ¶
type Client ¶
func NewClient ¶
func NewClient(http core.HTTPContext, ctx core.IntegrationContext) (*Client, error)
func (*Client) CreateIncident ¶
func (c *Client) CreateIncident(name, idempotencyKey, severityID, visibility, summary string) (*IncidentV2, error)
CreateIncident creates a new incident via POST /v2/incidents.
func (*Client) ListSeverities ¶
ListSeverities returns severities for the organization (used for Create Incident severity picker).
type Configuration ¶
type Configuration struct {
APIKey string `json:"apiKey"`
}
type CreateIncident ¶
type CreateIncident struct{}
func (*CreateIncident) Actions ¶
func (c *CreateIncident) Actions() []core.Action
func (*CreateIncident) Cancel ¶
func (c *CreateIncident) Cancel(ctx core.ExecutionContext) error
func (*CreateIncident) Cleanup ¶
func (c *CreateIncident) Cleanup(ctx core.SetupContext) error
func (*CreateIncident) Color ¶
func (c *CreateIncident) Color() string
func (*CreateIncident) Configuration ¶
func (c *CreateIncident) Configuration() []configuration.Field
func (*CreateIncident) Description ¶
func (c *CreateIncident) Description() string
func (*CreateIncident) Documentation ¶
func (c *CreateIncident) Documentation() string
func (*CreateIncident) ExampleOutput ¶
func (c *CreateIncident) ExampleOutput() map[string]any
func (*CreateIncident) Execute ¶
func (c *CreateIncident) Execute(ctx core.ExecutionContext) error
func (*CreateIncident) HandleAction ¶
func (c *CreateIncident) HandleAction(ctx core.ActionContext) error
func (*CreateIncident) HandleWebhook ¶
func (c *CreateIncident) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*CreateIncident) Icon ¶
func (c *CreateIncident) Icon() string
func (*CreateIncident) Label ¶
func (c *CreateIncident) Label() string
func (*CreateIncident) Name ¶
func (c *CreateIncident) Name() string
func (*CreateIncident) OutputChannels ¶
func (c *CreateIncident) OutputChannels(configuration any) []core.OutputChannel
func (*CreateIncident) ProcessQueueItem ¶
func (c *CreateIncident) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*CreateIncident) Setup ¶
func (c *CreateIncident) Setup(ctx core.SetupContext) error
type CreateIncidentRequest ¶
type CreateIncidentRequest struct {
Name string `json:"name"`
IdempotencyKey string `json:"idempotency_key"`
SeverityID string `json:"severity_id,omitempty"`
Visibility string `json:"visibility,omitempty"` // "public" or "private"
Summary string `json:"summary,omitempty"`
}
CreateIncidentRequest is the request body for POST /v2/incidents.
type CreateIncidentResponse ¶
type CreateIncidentResponse struct {
Incident IncidentV2 `json:"incident"`
}
CreateIncidentResponse is the response from POST /v2/incidents.
type CreateIncidentSpec ¶
type IncidentIO ¶
type IncidentIO struct{}
func (*IncidentIO) Actions ¶
func (i *IncidentIO) Actions() []core.Action
func (*IncidentIO) Cleanup ¶
func (i *IncidentIO) Cleanup(ctx core.IntegrationCleanupContext) error
func (*IncidentIO) Components ¶
func (i *IncidentIO) Components() []core.Component
func (*IncidentIO) Configuration ¶
func (i *IncidentIO) Configuration() []configuration.Field
func (*IncidentIO) Description ¶
func (i *IncidentIO) Description() string
func (*IncidentIO) HandleAction ¶
func (i *IncidentIO) HandleAction(ctx core.IntegrationActionContext) error
func (*IncidentIO) HandleRequest ¶
func (i *IncidentIO) HandleRequest(ctx core.HTTPRequestContext)
func (*IncidentIO) Icon ¶
func (i *IncidentIO) Icon() string
func (*IncidentIO) Instructions ¶
func (i *IncidentIO) Instructions() string
func (*IncidentIO) Label ¶
func (i *IncidentIO) Label() string
func (*IncidentIO) ListResources ¶
func (i *IncidentIO) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
func (*IncidentIO) Name ¶
func (i *IncidentIO) Name() string
func (*IncidentIO) Sync ¶
func (i *IncidentIO) Sync(ctx core.SyncContext) error
func (*IncidentIO) Triggers ¶
func (i *IncidentIO) Triggers() []core.Trigger
type IncidentIOWebhookHandler ¶
type IncidentIOWebhookHandler struct{}
func (*IncidentIOWebhookHandler) Cleanup ¶
func (h *IncidentIOWebhookHandler) Cleanup(ctx core.WebhookHandlerContext) error
func (*IncidentIOWebhookHandler) CompareConfig ¶
func (h *IncidentIOWebhookHandler) CompareConfig(a, b any) (bool, error)
func (*IncidentIOWebhookHandler) Merge ¶
func (h *IncidentIOWebhookHandler) Merge(current, requested any) (any, bool, error)
func (*IncidentIOWebhookHandler) Setup ¶
func (h *IncidentIOWebhookHandler) Setup(ctx core.WebhookHandlerContext) (any, error)
Setup does not call incident.io (no API to create webhook endpoints). The user adds the webhook URL in incident.io Settings > Webhooks and pastes the signing secret into the trigger.
type IncidentStatusRef ¶
IncidentStatusRef is an incident status reference.
type IncidentV2 ¶
type IncidentV2 struct {
ID string `json:"id"`
Name string `json:"name"`
Summary string `json:"summary"`
Reference string `json:"reference"`
Permalink string `json:"permalink"`
Visibility string `json:"visibility"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
Severity *SeverityRef `json:"severity,omitempty"`
IncidentStatus *IncidentStatusRef `json:"incident_status,omitempty"`
}
IncidentV2 represents an incident from incident.io API v2.
type OnIncident ¶
type OnIncident struct{}
func (*OnIncident) Actions ¶
func (t *OnIncident) Actions() []core.Action
func (*OnIncident) Cleanup ¶
func (t *OnIncident) Cleanup(ctx core.TriggerContext) error
func (*OnIncident) Color ¶
func (t *OnIncident) Color() string
func (*OnIncident) Configuration ¶
func (t *OnIncident) Configuration() []configuration.Field
func (*OnIncident) Description ¶
func (t *OnIncident) Description() string
func (*OnIncident) Documentation ¶
func (t *OnIncident) Documentation() string
func (*OnIncident) ExampleData ¶
func (t *OnIncident) ExampleData() map[string]any
func (*OnIncident) HandleAction ¶
func (t *OnIncident) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)
func (*OnIncident) HandleWebhook ¶
func (t *OnIncident) HandleWebhook(ctx core.WebhookRequestContext) (int, *core.WebhookResponseBody, error)
func (*OnIncident) Icon ¶
func (t *OnIncident) Icon() string
func (*OnIncident) Label ¶
func (t *OnIncident) Label() string
func (*OnIncident) Name ¶
func (t *OnIncident) Name() string
func (*OnIncident) Setup ¶
func (t *OnIncident) Setup(ctx core.TriggerContext) error
type OnIncidentConfiguration ¶
type OnIncidentMetadata ¶
type OnIncidentMetadata struct {
WebhookURL string `json:"webhookUrl" mapstructure:"webhookUrl"`
SigningSecretConfigured bool `json:"signingSecretConfigured" mapstructure:"signingSecretConfigured"`
}
OnIncidentMetadata is stored after Setup and includes the webhook URL and signing-secret status for the UI.
type Severity ¶
type Severity struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Rank int `json:"rank"`
}
Severity represents an incident.io severity level.
type SeverityListResponse ¶
type SeverityListResponse struct {
Severities []Severity `json:"severities"`
}
SeverityListResponse is the API response for listing severities.
type SeverityRef ¶
SeverityRef is a severity reference in incident payloads.
type WebhookConfiguration ¶
type WebhookConfiguration struct {
Events []string `json:"events"`
}
WebhookConfiguration is the config stored with the webhook (events only). The signing secret is stored in the encrypted webhook.Secret via the setSecret action.
type WebhookMetadata ¶
type WebhookMetadata struct{}
WebhookMetadata is stored after Setup. We do not create an endpoint via API, so metadata can be empty.