Documentation ¶
Index ¶
- Constants
- Variables
- type Delivery
- type DeliveryAttempt
- type DeliveryAttemptRepository
- type DeliveryAttemptService
- type DeliveryRepository
- type DeliveryService
- type ID
- type MigrationRepository
- type MigrationService
- type PingRepository
- type PingService
- type RepositoryGetOptions
- type RepositoryListOptions
- type Webhook
- type WebhookRepository
- type WebhookService
- type WorkerService
Constants ¶
const ( // DeliveryStatusPending represents the delivery pending status DeliveryStatusPending = "pending" // DeliveryStatusSucceeded represents the delivery succeeded status DeliveryStatusSucceeded = "succeeded" // DeliveryStatusFailed represents the delivery failed status DeliveryStatusFailed = "failed" )
Variables ¶
var ( // ErrWebhookNotFound is returned by any operation that can't load a webhook. ErrWebhookNotFound = errors.New("webhook_not_found") // ErrDeliveryNotFound is returned by any operation that can't load a delivery. ErrDeliveryNotFound = errors.New("delivery_not_found") // ErrDeliveryAttemptNotFound is returned by any operation that can't load a delivery attempt. ErrDeliveryAttemptNotFound = errors.New("delivery_attempt_not_found") )
Functions ¶
This section is empty.
Types ¶
type Delivery ¶
type Delivery struct { ID ID `json:"id" db:"id"` WebhookID ID `json:"webhook_id" db:"webhook_id"` Payload string `json:"payload" db:"payload"` ScheduledAt time.Time `json:"scheduled_at" db:"scheduled_at"` DeliveryAttempts int `json:"delivery_attempts" db:"delivery_attempts"` Status string `json:"status" db:"status"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` } //@name Delivery
Delivery represents a payload that must be delivery using webhook context.
type DeliveryAttempt ¶
type DeliveryAttempt struct { ID ID `json:"id" db:"id"` WebhookID ID `json:"webhook_id" db:"webhook_id"` DeliveryID ID `json:"delivery_id" db:"delivery_id"` RawRequest string `json:"raw_request" db:"raw_request"` RawResponse string `json:"raw_response" db:"raw_response"` ResponseStatusCode int `json:"response_status_code" db:"response_status_code"` ExecutionDuration int `json:"execution_duration" db:"execution_duration"` Success bool `json:"success" db:"success"` Error string `json:"error" db:"error"` CreatedAt time.Time `json:"created_at" db:"created_at"` } //@name DeliveryAttempt
DeliveryAttempt represents a delivery attempt.
type DeliveryAttemptRepository ¶
type DeliveryAttemptRepository interface { Get(ctx context.Context, getOptions RepositoryGetOptions) (*DeliveryAttempt, error) List(ctx context.Context, listOptions RepositoryListOptions) ([]*DeliveryAttempt, error) Create(ctx context.Context, deliveryAttempt *DeliveryAttempt) error }
DeliveryAttemptRepository is the interface that will be used to iterate with the DeliveryAttempt data.
type DeliveryAttemptService ¶
type DeliveryAttemptService interface { Get(ctx context.Context, getOptions RepositoryGetOptions) (*DeliveryAttempt, error) List(ctx context.Context, listOptions RepositoryListOptions) ([]*DeliveryAttempt, error) }
DeliveryAttemptService is the interface that will be used to perform operations with delivery attempt.
type DeliveryRepository ¶
type DeliveryRepository interface { Get(ctx context.Context, getOptions RepositoryGetOptions) (*Delivery, error) List(ctx context.Context, listOptions RepositoryListOptions) ([]*Delivery, error) Create(ctx context.Context, delivery *Delivery) error Update(ctx context.Context, delivery *Delivery) error Delete(ctx context.Context, id ID) error Dispatch(ctx context.Context) (*DeliveryAttempt, error) }
DeliveryRepository is the interface that will be used to iterate with the Delivery data.
type DeliveryService ¶
type DeliveryService interface { Get(ctx context.Context, getOptions RepositoryGetOptions) (*Delivery, error) List(ctx context.Context, listOptions RepositoryListOptions) ([]*Delivery, error) Create(ctx context.Context, delivery *Delivery) error Update(ctx context.Context, delivery *Delivery) error Delete(ctx context.Context, id ID) error }
DeliveryService is the interface that will be used to perform operations with deliveries.
type MigrationRepository ¶
MigrationRepository is the interface that will be used to run database migrations.
type MigrationService ¶
MigrationService is the interface that will be used to execute database migrations.
type PingRepository ¶
PingRepository is the interface that will be used to run ping against database.
type PingService ¶
PingService is the interface that will be used to perform ping operation against database.
type RepositoryGetOptions ¶
type RepositoryGetOptions struct {
Filters map[string]interface{}
}
RepositoryGetOptions contains options used in the Get methods.
type RepositoryListOptions ¶
type RepositoryListOptions struct { Filters map[string]interface{} Limit int Offset int OrderBy string Order string }
RepositoryListOptions contains options used in the List methods.
type Webhook ¶
type Webhook struct { ID ID `json:"id" db:"id"` Name string `json:"name" db:"name"` URL string `json:"url" db:"url"` ContentType string `json:"content_type" db:"content_type"` ValidStatusCodes pq.Int32Array `json:"valid_status_codes" db:"valid_status_codes"` SecretToken string `json:"secret_token" db:"secret_token"` Active bool `json:"active" db:"active"` MaxDeliveryAttempts int `json:"max_delivery_attempts" db:"max_delivery_attempts"` DeliveryAttemptTimeout int `json:"delivery_attempt_timeout" db:"delivery_attempt_timeout"` RetryMinBackoff int `json:"retry_min_backoff" db:"retry_min_backoff"` RetryMaxBackoff int `json:"retry_max_backoff" db:"retry_max_backoff"` CreatedAt time.Time `json:"created_at" db:"created_at"` UpdatedAt time.Time `json:"updated_at" db:"updated_at"` } //@name Webhook
Webhook represents a webhook in the system.
type WebhookRepository ¶
type WebhookRepository interface { Get(ctx context.Context, getOptions RepositoryGetOptions) (*Webhook, error) List(ctx context.Context, listOptions RepositoryListOptions) ([]*Webhook, error) Create(ctx context.Context, webhook *Webhook) error Update(ctx context.Context, webhook *Webhook) error Delete(ctx context.Context, id ID) error }
WebhookRepository is the interface that will be used to iterate with the Webhook data.
type WebhookService ¶
type WebhookService interface { Get(ctx context.Context, getOptions RepositoryGetOptions) (*Webhook, error) List(ctx context.Context, listOptions RepositoryListOptions) ([]*Webhook, error) Create(ctx context.Context, webhook *Webhook) error Update(ctx context.Context, webhook *Webhook) error Delete(ctx context.Context, id ID) error }
WebhookService is the interface that will be used to perform operations with webhooks.