Documentation ¶
Index ¶
- Variables
- type APIResponse
- type AlertConfiguration
- type ApiKey
- type ApiKeyAuth
- type BasicAuth
- type BatchResendRequest
- type ConfigOpts
- type Convoy
- type CreateEndpointRequest
- type CreateEventRequest
- type CreateFanoutEventRequest
- type CreateProjectRequest
- type CreateSourceRequest
- type CreateSubscriptionRequest
- type DeliveryAttempt
- type DeliveryAttemptQueryParam
- type DeliveryAttemptResponse
- type EncodingType
- type Endpoint
- func (e *Endpoint) All(query *EndpointQueryParam) (*ListEndpointResponse, error)
- func (e *Endpoint) Create(opts *CreateEndpointRequest, query *EndpointQueryParam) (*EndpointResponse, error)
- func (e *Endpoint) Delete(endpointId string, query *EndpointQueryParam) error
- func (e *Endpoint) Find(endpointId string, query *EndpointQueryParam) (*EndpointResponse, error)
- func (e *Endpoint) Update(endpointId string, opts *CreateEndpointRequest, query *EndpointQueryParam) (*EndpointResponse, error)
- type EndpointAuth
- type EndpointQueryParam
- type EndpointResponse
- type Event
- func (e *Event) All(query *EventQueryParam) (*ListEventResponse, error)
- func (e *Event) Create(opts *CreateEventRequest, query *EventQueryParam) (*EventResponse, error)
- func (e *Event) CreateFanoutEvent(opts *CreateFanoutEventRequest) (*EventResponse, error)
- func (e *Event) Find(id string, query *EventQueryParam) (*EventResponse, error)
- type EventDelivery
- func (e *EventDelivery) All(query *EventDeliveryQueryParam) (*ListEventDeliveryResponse, error)
- func (e *EventDelivery) BatchResend(opts *BatchResendRequest, query *EventDeliveryQueryParam) error
- func (e *EventDelivery) Find(id string, query *EventDeliveryQueryParam) (*EventDeliveryResponse, error)
- func (e *EventDelivery) Resend(id string, query *EventDeliveryQueryParam) (*EventDeliveryResponse, error)
- type EventDeliveryQueryParam
- type EventDeliveryResponse
- type EventMetadata
- type EventQueryParam
- type EventResponse
- type FilterConfiguration
- type HMac
- type HttpClient
- type ListDeliveryAttemptResponse
- type ListEndpointResponse
- type ListEventDeliveryResponse
- type ListEventResponse
- type ListProjectResponse
- type ListSourceResponse
- type ListSubscriptionResponse
- type Metadata
- type Options
- type Pagination
- type Project
- type ProjectConfig
- type ProjectMetadata
- type ProjectResponse
- type ProviderConfig
- type QueryParameter
- type RateLimitConfiguration
- type RetentionPolicyConfiguration
- type RetryConfiguration
- type Secret
- type SignatureConfiguration
- type Source
- func (s *Source) All(query *SourceQueryParam) (*ListSourceResponse, error)
- func (s *Source) Create(opts *CreateSourceRequest) (*SourceResponse, error)
- func (s *Source) Delete(id string) error
- func (s *Source) Find(id string) (*SourceResponse, error)
- func (s *Source) Update(id string, opts *CreateSourceRequest) (*SourceResponse, error)
- type SourceQueryParam
- type SourceResponse
- type StrategyConfiguration
- type Subscription
- func (s *Subscription) All(query *SubscriptionQueryParam) (*ListSubscriptionResponse, error)
- func (s *Subscription) Create(opts *CreateSubscriptionRequest) (*SubscriptionResponse, error)
- func (s *Subscription) Delete(id string) error
- func (s *Subscription) Find(id string) (*SubscriptionResponse, error)
- func (s *Subscription) Update(id string, opts *CreateSubscriptionRequest) (*SubscriptionResponse, error)
- type SubscriptionQueryParam
- type SubscriptionResponse
- type TwitterProviderConfig
- type VerifierConfig
- type Webhook
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotListDeliveryAttemptResponse = errors.New("invalid list delivery attempt response") ErrNotDeliveryAttemptResponse = errors.New("invalid delivery attempt response") )
View Source
var ( ErrNotListEndpointResponse = errors.New("invalid list endpoint response") ErrNotEndpointResponse = errors.New("invalid endpoint response") )
View Source
var ( ErrNotListEventResponse = errors.New("invalid list event response") ErrNotEventResponse = errors.New("invalid event response") )
View Source
var ( ErrNotListEventDeliveryResponse = errors.New("invalid list event delivery response") ErrNotEventDeliveryResponse = errors.New("invalid event delivery response") )
View Source
var ( ErrNotListProjectResponse = errors.New("invalid list project response") ErrNotProjectResponse = errors.New("invalid project response") )
View Source
var ( ErrNotListSourceResponse = errors.New("invalid list source response") ErrNotSourceResponse = errors.New("invalid source response") )
View Source
var ( ErrNotListSubscriptionResponse = errors.New("invalid list subscription response") ErrNotSubscriptionResponse = errors.New("invalid subscription response") )
View Source
var ( ErrInvalidSignatureHeader = errors.New("webhook has no signature header") ErrInvalidHeader = errors.New("webhook has invalid header") ErrInvalidEncoding = errors.New("invalid encoding") ErrInvalidSignature = errors.New("webhook has no valid signature") ErrInvalidHashAlgorithm = errors.New("invalid hash algorithm") ErrTimestampExpired = errors.New("timestamp has expired") )
View Source
var ( DefaultTolerance = 300 * time.Second DefaultEncoding EncodingType = HexEncoding DefaultHash = "SHA256" )
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶ added in v0.3.0
type APIResponse struct { Status bool `json:"status"` Message string `json:"message"` Data *json.RawMessage `json:"data,omitempty"` }
type AlertConfiguration ¶ added in v0.3.1
type ApiKeyAuth ¶ added in v1.0.0
type BatchResendRequest ¶ added in v0.3.0
type BatchResendRequest struct {
IDs []string `json:"ids"`
}
type ConfigOpts ¶ added in v0.3.2
type Convoy ¶
type Convoy struct { Projects *Project Endpoints *Endpoint Events *Event EventDeliveries *EventDelivery DeliveryAttempts *DeliveryAttempt Sources *Source Subscriptions *Subscription // contains filtered or unexported fields }
type CreateEndpointRequest ¶ added in v0.3.0
type CreateEndpointRequest struct { Name string `json:"name"` SupportEmail string `json:"support_email"` OwnerID string `json:"owner_id"` SlackWebhookUrl string `json:"slack_webhook_url"` URL string `json:"url"` Secret string `json:"secret,omitempty"` Description string `json:"description,omitempty"` AdvancedSignatures *bool `json:"advanced_signatures"` IsDisabled bool `json:"is_disabled"` Authentication *EndpointAuth `json:"authentication"` HttpTimeout string `json:"http_timeout,omitempty"` RateLimit int `json:"rate_limit,omitempty"` RateLimitDuration string `json:"rate_limit_duration,omitempty"` }
type CreateEventRequest ¶ added in v0.3.0
type CreateFanoutEventRequest ¶ added in v1.0.2
type CreateProjectRequest ¶ added in v1.0.0
type CreateSourceRequest ¶ added in v0.3.1
type CreateSourceRequest struct { Name string `json:"name"` Type string `json:"type"` Provider string `json:"provider"` IsDisabled bool `json:"is_disabled"` Verifier VerifierConfig `json:"verifier"` }
type CreateSubscriptionRequest ¶ added in v0.3.1
type CreateSubscriptionRequest struct { Name string `json:"name"` SourceID string `json:"source_id"` EndpointID string `json:"endpoint_id"` AlertConfig *AlertConfiguration `json:"alert_config"` RetryConfig *RetryConfiguration `json:"retry_config"` FilterConfig *FilterConfiguration `json:"filter_config"` }
type DeliveryAttempt ¶ added in v0.3.0
type DeliveryAttempt struct {
// contains filtered or unexported fields
}
func (*DeliveryAttempt) All ¶ added in v0.3.0
func (d *DeliveryAttempt) All(eventDeliveryId string, query *DeliveryAttemptQueryParam) (*ListDeliveryAttemptResponse, error)
func (*DeliveryAttempt) Find ¶ added in v0.3.0
func (d *DeliveryAttempt) Find(eventDeliveryId, deliveryAttemptId string, query *DeliveryAttemptQueryParam) (*DeliveryAttemptResponse, error)
type DeliveryAttemptQueryParam ¶ added in v0.3.0
type DeliveryAttemptQueryParam struct {
GroupID string
}
type DeliveryAttemptResponse ¶ added in v0.3.0
type DeliveryAttemptResponse struct { UID string `json:"uid"` MsgID string `json:"msg_id"` URL string `json:"url"` Method string `json:"method"` EndpointID string `json:"endpoint_id"` APIVersion string `json:"api_version"` IPAddress string `json:"ip_address,omitempty"` RequestHeader map[string]string `json:"request_http_header,omitempty"` ResponseHeader map[string]string `json:"response_http_header,omitempty"` HttpResponseCode string `json:"http_status,omitempty"` ResponseData string `json:"response_data,omitempty"` Error string `json:"error,omitempty"` Status bool `json:"status,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` DeletedAt time.Time `json:"deleted_at,omitempty"` }
type EncodingType ¶ added in v0.3.2
type EncodingType string
const ( Base64Encoding EncodingType = "base64" HexEncoding EncodingType = "hex" )
type Endpoint ¶ added in v0.3.0
type Endpoint struct {
// contains filtered or unexported fields
}
func (*Endpoint) All ¶ added in v0.3.0
func (e *Endpoint) All(query *EndpointQueryParam) (*ListEndpointResponse, error)
func (*Endpoint) Create ¶ added in v0.3.0
func (e *Endpoint) Create(opts *CreateEndpointRequest, query *EndpointQueryParam) (*EndpointResponse, error)
func (*Endpoint) Delete ¶ added in v0.3.0
func (e *Endpoint) Delete(endpointId string, query *EndpointQueryParam) error
func (*Endpoint) Find ¶ added in v0.3.0
func (e *Endpoint) Find(endpointId string, query *EndpointQueryParam) (*EndpointResponse, error)
func (*Endpoint) Update ¶ added in v0.3.0
func (e *Endpoint) Update(endpointId string, opts *CreateEndpointRequest, query *EndpointQueryParam) (*EndpointResponse, error)
type EndpointAuth ¶ added in v1.0.0
type EndpointAuth struct { Type string `json:"type"` ApiKey *ApiKeyAuth `json:"api_key"` }
type EndpointQueryParam ¶ added in v0.3.0
type EndpointResponse ¶ added in v0.3.0
type EndpointResponse struct { UID string `json:"uid"` GroupID string `json:"group_id"` OwnerID string `json:"owner_id"` TargetUrl string `json:"target_url"` Title string `json:"title"` Description string `json:"description"` Status string `json:"status"` Secrets []Secret `json:"secrets"` AdvancedSignatures bool `json:"advanced_signatures"` SlackWebhookUrl string `json:"slack_webhook_url"` SupportEmail string `json:"support_email"` IsDisabled bool `json:"is_disabled"` HttpTimeout string `json:"http_timeout"` RateLimit int `json:"rate_limit"` RateLimitDuration string `json:"rate_limit_duration"` Authentication *EndpointAuth `json:"authentication"` Events int64 `json:"events"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type Event ¶ added in v0.3.0
type Event struct {
// contains filtered or unexported fields
}
func (*Event) All ¶ added in v0.3.0
func (e *Event) All(query *EventQueryParam) (*ListEventResponse, error)
func (*Event) Create ¶ added in v0.3.0
func (e *Event) Create(opts *CreateEventRequest, query *EventQueryParam) (*EventResponse, error)
func (*Event) CreateFanoutEvent ¶ added in v1.0.2
func (e *Event) CreateFanoutEvent(opts *CreateFanoutEventRequest) (*EventResponse, error)
func (*Event) Find ¶ added in v0.3.0
func (e *Event) Find(id string, query *EventQueryParam) (*EventResponse, error)
type EventDelivery ¶ added in v0.3.0
type EventDelivery struct {
// contains filtered or unexported fields
}
func (*EventDelivery) All ¶ added in v0.3.0
func (e *EventDelivery) All(query *EventDeliveryQueryParam) (*ListEventDeliveryResponse, error)
func (*EventDelivery) BatchResend ¶ added in v0.3.0
func (e *EventDelivery) BatchResend(opts *BatchResendRequest, query *EventDeliveryQueryParam) error
func (*EventDelivery) Find ¶ added in v0.3.0
func (e *EventDelivery) Find(id string, query *EventDeliveryQueryParam) (*EventDeliveryResponse, error)
func (*EventDelivery) Resend ¶ added in v0.3.0
func (e *EventDelivery) Resend(id string, query *EventDeliveryQueryParam) (*EventDeliveryResponse, error)
type EventDeliveryQueryParam ¶ added in v0.3.0
type EventDeliveryResponse ¶ added in v0.3.0
type EventDeliveryResponse struct { UID string `json:"uid"` EventMetadata EventMetadata `json:"event_metadata"` EndpointMetadata EndpointResponse `json:"endpoint_metadata"` Metadata Metadata `json:"metadata"` Description string `json:"description,omitempty"` Status string `json:"status"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type EventMetadata ¶ added in v0.3.0
type EventQueryParam ¶ added in v0.3.0
type EventResponse ¶ added in v0.3.0
type EventResponse struct { UID string `json:"uid"` EventType string `json:"event_type"` MatchedEndpoints int `json:"matched_endpoints"` ProviderID string `json:"provider_id"` Data json.RawMessage `json:"data"` EndpointMetadata []*EndpointResponse `json:"endpoint_metadata"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type FilterConfiguration ¶ added in v0.3.1
type FilterConfiguration struct {
EventTypes []string `json:"event_types" bson:"event_types,omitempty"`
}
type HttpClient ¶ added in v0.3.0
type HttpClient struct {
// contains filtered or unexported fields
}
func NewClient ¶ added in v0.3.0
func NewClient(opts Options) *HttpClient
func (*HttpClient) SendRequest ¶ added in v0.3.0
func (c *HttpClient) SendRequest(opts *requestOpts) (interface{}, error)
type ListDeliveryAttemptResponse ¶ added in v0.3.0
type ListDeliveryAttemptResponse []DeliveryAttemptResponse
type ListEndpointResponse ¶ added in v0.3.0
type ListEndpointResponse struct { Content []EndpointResponse `json:"content"` Pagination Pagination `json:"pagination"` }
type ListEventDeliveryResponse ¶ added in v0.3.0
type ListEventDeliveryResponse struct { Content []EventDeliveryResponse `json:"content"` Pagination Pagination `json:"pagination"` }
type ListEventResponse ¶ added in v0.3.0
type ListEventResponse struct { Content []EventResponse `json:"content"` Pagination Pagination `json:"pagination"` }
type ListProjectResponse ¶ added in v1.0.0
type ListProjectResponse []ProjectResponse
type ListSourceResponse ¶ added in v0.3.1
type ListSourceResponse struct { Content []SourceResponse `json:"content"` Pagination Pagination `json:"pagination"` }
type ListSubscriptionResponse ¶ added in v0.3.1
type ListSubscriptionResponse struct { Content []SubscriptionResponse `json:"content"` Pagination Pagination `json:"pagination"` }
type Metadata ¶ added in v0.3.0
type Metadata struct { // Data to be sent to endpoint. Data json.RawMessage `json:"data"` Strategy string `json:"strategy"` // NextSendTime denotes the next time a Event will be published in // case it failed the first time NextSendTime time.Time `json:"next_send_time"` // NumTrials: number of times we have tried to deliver this Event to // an application NumTrials uint64 `json:"num_trials"` IntervalSeconds uint64 `json:"interval_seconds"` RetryLimit uint64 `json:"retry_limit"` }
type Pagination ¶ added in v0.3.0
type Project ¶ added in v1.0.0
type Project struct {
// contains filtered or unexported fields
}
func (*Project) Update ¶ added in v1.0.0
func (g *Project) Update(id string, opts *CreateProjectRequest) (*ProjectResponse, error)
type ProjectConfig ¶ added in v1.0.0
type ProjectConfig struct { RateLimit *RateLimitConfiguration `json:"ratelimit"` Strategy *StrategyConfiguration `json:"strategy"` Signature *SignatureConfiguration `json:"signature"` RetentionPolicy *RetentionPolicyConfiguration `json:"retention_policy"` DisableEndpoint bool `json:"disable_endpoint"` ReplayAttacks bool `json:"replay_attacks"` IsRetentionPolicyEnabled bool `json:"is_retention_policy_enabled"` }
type ProjectMetadata ¶ added in v1.0.0
type ProjectMetadata struct {
RetainedEvents int `json:"retained_events"`
}
type ProjectResponse ¶ added in v1.0.0
type ProjectResponse struct { UID string `json:"uid"` Name string `json:"name"` LogoUrl string `json:"logo_url"` OrganisationID string `json:"organisation_id"` Type string `json:"type"` Config *ProjectConfig `json:"config"` Statistics struct { MessageSent int `json:"messages_sent"` TotalApps int `json:"total_apps"` } `json:"statistics"` RateLimit int `json:"rate_limit"` RateLimitDuration string `json:"rate_limit_duration"` Metadata *ProjectMetadata `json:"metadata"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
type ProviderConfig ¶ added in v0.3.1
type ProviderConfig struct {
Twitter *TwitterProviderConfig `json:"twitter" bson:"twitter"`
}
type QueryParameter ¶ added in v0.3.0
type RateLimitConfiguration ¶ added in v0.3.1
type RetentionPolicyConfiguration ¶ added in v0.3.1
type RetentionPolicyConfiguration struct {
Policy string `json:"policy"`
}
type RetryConfiguration ¶ added in v0.3.1
type SignatureConfiguration ¶ added in v0.3.0
type Source ¶ added in v0.3.1
type Source struct {
// contains filtered or unexported fields
}
func (*Source) All ¶ added in v0.3.1
func (s *Source) All(query *SourceQueryParam) (*ListSourceResponse, error)
func (*Source) Create ¶ added in v0.3.1
func (s *Source) Create(opts *CreateSourceRequest) (*SourceResponse, error)
func (*Source) Update ¶ added in v0.3.1
func (s *Source) Update(id string, opts *CreateSourceRequest) (*SourceResponse, error)
type SourceQueryParam ¶ added in v0.3.1
type SourceResponse ¶ added in v0.3.1
type SourceResponse struct { UID string `json:"uid"` GroupID string `json:"group_id"` MaskID string `json:"mask_id"` Name string `json:"name"` Type string `json:"type"` Provider string `json:"provider"` IsDisabled bool `json:"is_disabled"` Verifier *VerifierConfig `json:"verifier"` ProviderConfig *ProviderConfig `json:"provider_config"` ForwardHeaders []string `json:"forward_headers"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
type StrategyConfiguration ¶ added in v0.3.0
type Subscription ¶ added in v0.3.1
type Subscription struct {
// contains filtered or unexported fields
}
func (*Subscription) All ¶ added in v0.3.1
func (s *Subscription) All(query *SubscriptionQueryParam) (*ListSubscriptionResponse, error)
func (*Subscription) Create ¶ added in v0.3.1
func (s *Subscription) Create(opts *CreateSubscriptionRequest) (*SubscriptionResponse, error)
func (*Subscription) Delete ¶ added in v0.3.1
func (s *Subscription) Delete(id string) error
func (*Subscription) Find ¶ added in v0.3.1
func (s *Subscription) Find(id string) (*SubscriptionResponse, error)
func (*Subscription) Update ¶ added in v0.3.1
func (s *Subscription) Update(id string, opts *CreateSubscriptionRequest) (*SubscriptionResponse, error)
type SubscriptionQueryParam ¶ added in v0.3.1
type SubscriptionResponse ¶ added in v0.3.1
type SubscriptionResponse struct { UID string `json:"uid"` Name string `json:"name"` Type string `json:"type"` Status string `json:"status"` Source *SourceResponse `json:"source_metadata,omitempty"` Endpoint *EndpointResponse `json:"endpoint_metadata,omitempty"` // subscription config AlertConfig *AlertConfiguration `json:"alert_config,omitempty"` RetryConfig *RetryConfiguration `json:"retry_config,omitempty"` FilterConfig *FilterConfiguration `json:"filter_config,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` }
type TwitterProviderConfig ¶ added in v0.3.1
type VerifierConfig ¶ added in v0.3.1
type Webhook ¶ added in v0.3.2
type Webhook struct { Payload []byte SigHeader string Secret string IsAdvanced bool Encoding EncodingType Hash string Tolerance time.Duration }
func NewWebhook ¶ added in v0.3.2
func NewWebhook(data *ConfigOpts) *Webhook
Source Files ¶
Click to show internal directories.
Click to hide internal directories.