Documentation
¶
Index ¶
- Variables
- type APIResponse
- type AlertConfiguration
- type ApiKey
- type AppMetadata
- type Application
- func (a *Application) All(query *ApplicationQueryParam) (*ListApplicationResponse, error)
- func (a *Application) Create(opts *CreateApplicationRequest, query *ApplicationQueryParam) (*ApplicationResponse, error)
- func (a *Application) Delete(id string, query *ApplicationQueryParam) error
- func (a *Application) Find(id string, query *ApplicationQueryParam) (*ApplicationResponse, error)
- func (a *Application) Update(id string, opts *CreateApplicationRequest, query *ApplicationQueryParam) (*ApplicationResponse, error)
- type ApplicationQueryParam
- type ApplicationResponse
- type BasicAuth
- type BatchResendRequest
- type ConfigOpts
- type Convoy
- type CreateApplicationRequest
- type CreateEndpointRequest
- type CreateEventRequest
- type CreateGroupRequest
- type CreateSourceRequest
- type CreateSubscriptionRequest
- type DeliveryAttempt
- type DeliveryAttemptQueryParam
- type DeliveryAttemptResponse
- type EncodingType
- type Endpoint
- func (e *Endpoint) All(appId string, query *EndpointQueryParam) (*ListEndpointResponse, error)
- func (e *Endpoint) Create(appId string, opts *CreateEndpointRequest, query *EndpointQueryParam) (*EndpointResponse, error)
- func (e *Endpoint) Delete(appId, endpointId string, query *EndpointQueryParam) error
- func (e *Endpoint) Find(appId, endpointId string, query *EndpointQueryParam) (*EndpointResponse, error)
- func (e *Endpoint) Update(appId, endpointId string, opts *CreateEndpointRequest, ...) (*EndpointResponse, error)
- type EndpointMetadata
- type EndpointQueryParam
- type EndpointResponse
- type Event
- 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 Group
- func (g *Group) All(query *GroupQueryParams) (*ListGroupResponse, error)
- func (g *Group) Create(opts *CreateGroupRequest) (*GroupResponse, error)
- func (g *Group) Delete(id string) error
- func (g *Group) Find(id string) (*GroupResponse, error)
- func (g *Group) Update(id string, opts *CreateGroupRequest) (*GroupResponse, error)
- type GroupConfig
- type GroupMetadata
- type GroupQueryParams
- type GroupResponse
- type HMac
- type HttpClient
- type ListApplicationResponse
- type ListDeliveryAttemptResponse
- type ListEndpointResponse
- type ListEventDeliveryResponse
- type ListEventResponse
- type ListGroupResponse
- type ListSourceResponse
- type ListSubscriptionResponse
- type Metadata
- type Options
- type Pagination
- type ProviderConfig
- type QueryParameter
- type RateLimitConfiguration
- type RetentionPolicyConfiguration
- type RetryConfiguration
- 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 ( ErrNotListApplicationResponse = errors.New("invalid list application response") ErrNotApplicationResponse = errors.New("invalid application response") )
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 ( ErrNotListGroupResponse = errors.New("invalid list group response") ErrNotGroupResponse = errors.New("invalid group 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 AppMetadata ¶ added in v0.3.0
type Application ¶ added in v0.3.0
type Application struct {
// contains filtered or unexported fields
}
func (*Application) All ¶ added in v0.3.0
func (a *Application) All(query *ApplicationQueryParam) (*ListApplicationResponse, error)
func (*Application) Create ¶ added in v0.3.0
func (a *Application) Create(opts *CreateApplicationRequest, query *ApplicationQueryParam) (*ApplicationResponse, error)
func (*Application) Delete ¶ added in v0.3.0
func (a *Application) Delete(id string, query *ApplicationQueryParam) error
func (*Application) Find ¶ added in v0.3.0
func (a *Application) Find(id string, query *ApplicationQueryParam) (*ApplicationResponse, error)
func (*Application) Update ¶ added in v0.3.0
func (a *Application) Update(id string, opts *CreateApplicationRequest, query *ApplicationQueryParam) (*ApplicationResponse, error)
type ApplicationQueryParam ¶ added in v0.3.0
type ApplicationResponse ¶ added in v0.3.0
type ApplicationResponse struct {
UID string `json:"uid"`
GroupID string `json:"group_id"`
Name string `json:"name"`
Endpoints []EndpointResponse `json:"endpoints"`
SupportEmail string `json:"support_email"`
IsDisabled bool `json:"is_disabled"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Events int64 `json:"events"`
}
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 {
Applications *Application
Groups *Group
Endpoints *Endpoint
Events *Event
EventDeliveries *EventDelivery
DeliveryAttempts *DeliveryAttempt
Sources *Source
Subscriptions *Subscription
// contains filtered or unexported fields
}
type CreateApplicationRequest ¶ added in v0.3.0
type CreateEndpointRequest ¶ added in v0.3.0
type CreateEndpointRequest struct {
URL string `json:"url"`
Secret string `json:"secret,omitempty"`
Description string `json:"description,omitempty"`
Events []string `json:"events,omitempty"`
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 CreateEventRequest struct {
AppID string `json:"app_id"`
EventType string `json:"event_type"`
Data json.RawMessage `json:"data"`
}
type CreateGroupRequest ¶ added in v0.3.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"`
AppID string `json:"app_id"`
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(appId string, query *EndpointQueryParam) (*ListEndpointResponse, error)
func (*Endpoint) Create ¶ added in v0.3.0
func (e *Endpoint) Create(appId string, opts *CreateEndpointRequest, query *EndpointQueryParam) (*EndpointResponse, error)
func (*Endpoint) Delete ¶ added in v0.3.0
func (e *Endpoint) Delete(appId, endpointId string, query *EndpointQueryParam) error
func (*Endpoint) Find ¶ added in v0.3.0
func (e *Endpoint) Find(appId, endpointId string, query *EndpointQueryParam) (*EndpointResponse, error)
func (*Endpoint) Update ¶ added in v0.3.0
func (e *Endpoint) Update(appId, endpointId string, opts *CreateEndpointRequest, query *EndpointQueryParam) (*EndpointResponse, error)
type EndpointMetadata ¶ added in v0.3.0
type EndpointMetadata struct {
UID string `json:"uid"`
TargetURL string `json:"target_url"`
Status string `json:"status"`
Secret string `json:"secret"`
HttpTimeout string `json:"http_timeout"`
RateLimit int `json:"rate_limit"`
RateLimitDuration string `json:"rate_limit_duration"`
Sent bool `json:"sent"`
}
type EndpointQueryParam ¶ added in v0.3.0
type EndpointQueryParam struct {
GroupID string
}
type EndpointResponse ¶ added in v0.3.0
type EndpointResponse struct {
UID string `json:"uid"`
TargetUrl string `json:"target_url"`
Description string `json:"description"`
Status string `json:"status"`
Secret string `json:"secret"`
HttpTimeout string `json:"http_timeout"`
RateLimit int `json:"rate_limit"`
RateLimitDuration string `json:"rate_limit_duration"`
Events []string `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) 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 EndpointMetadata `json:"endpoint"`
AppMetadata AppMetadata `json:"app_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"`
AppMetadata AppMetadata `json:"app_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 Group ¶ added in v0.3.0
type Group struct {
// contains filtered or unexported fields
}
func (*Group) All ¶ added in v0.3.0
func (g *Group) All(query *GroupQueryParams) (*ListGroupResponse, error)
func (*Group) Create ¶ added in v0.3.0
func (g *Group) Create(opts *CreateGroupRequest) (*GroupResponse, error)
func (*Group) Update ¶ added in v0.3.0
func (g *Group) Update(id string, opts *CreateGroupRequest) (*GroupResponse, error)
type GroupConfig ¶ added in v0.3.0
type GroupConfig 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 GroupMetadata ¶ added in v0.3.1
type GroupMetadata struct {
RetainedEvents int `json:"retained_events"`
}
type GroupQueryParams ¶ added in v0.3.0
type GroupResponse ¶ added in v0.3.0
type GroupResponse struct {
UID string `json:"uid"`
Name string `json:"name"`
LogoUrl string `json:"logo_url"`
OrganisationID string `json:"organisation_id"`
Type string `json:"type"`
Config *GroupConfig `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 *GroupMetadata `json:"metadata"`
CreatedAt time.Time `json:"created_at,omitempty"`
UpdatedAt time.Time `json:"updated_at,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 ListApplicationResponse ¶ added in v0.3.0
type ListApplicationResponse struct {
Content []ApplicationResponse `json:"content"`
Pagination Pagination `json:"pagination"`
}
type ListDeliveryAttemptResponse ¶ added in v0.3.0
type ListDeliveryAttemptResponse []DeliveryAttemptResponse
type ListEndpointResponse ¶ added in v0.3.0
type ListEndpointResponse []EndpointResponse
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 ListGroupResponse ¶ added in v0.3.0
type ListGroupResponse []GroupResponse
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 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"`
App *ApplicationResponse `json:"app_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.