Versions in this module Expand all Collapse all v0 v0.3.0 Jul 20, 2026 Changes in this version + const DefaultToleranceSeconds + const Version + func Sign(secret string, body []byte, timestamp int64) string + func Verify(secret string, body []byte, signature string, opts *VerifyOptions) bool + type APIError struct + Code string + Message string + StatusCode int + func (e *APIError) Error() string + type ApiKey struct + CreatedAt *string + CreatedBy *string + ExpiresAt *string + Id string + Key *string + Name string + Scope string + type Client struct + func New(baseURL, apiKey string, opts ...Option) *Client + func (c *Client) CreateAPIKey(ctx context.Context, opts *CreateAPIKeyOptions) (*ApiKey, error) + func (c *Client) CreateEndpoint(ctx context.Context, endpointURL string, opts *CreateEndpointOptions) (*Endpoint, error) + func (c *Client) DeleteEndpoint(ctx context.Context, id string) error + func (c *Client) Drain(ctx context.Context, opts *DrainOptions) (DrainResult, error) + func (c *Client) EnableEndpoint(ctx context.Context, id string) (*Endpoint, error) + func (c *Client) Enqueue(ctx context.Context, eventType string, payload map[string]any, ...) (string, error) + func (c *Client) GetEndpoint(ctx context.Context, id string) (*Endpoint, error) + func (c *Client) ListDeliveries(ctx context.Context, opts *ListDeliveriesOptions) (*Page[Delivery], error) + func (c *Client) ListEndpoints(ctx context.Context, opts *ListEndpointsOptions) (*Page[Endpoint], error) + func (c *Client) Publish(ctx context.Context, eventType string, payload map[string]any, ...) (*Event, error) + func (c *Client) Redeliver(ctx context.Context, id string) (*Delivery, error) + func (c *Client) RevokeAPIKey(ctx context.Context, id string) error + func (c *Client) RotateEndpointSecret(ctx context.Context, id string) (*Endpoint, error) + func (c *Client) StartDrainer(ctx context.Context, interval time.Duration, opts *DrainOptions) + func (c *Client) StopDrainer() + func (c *Client) UpdateEndpoint(ctx context.Context, id string, patch Patch) (*Endpoint, error) + type CreateAPIKeyOptions struct + ExpiresInDays *int + Name string + Scope string + type CreateEndpointOptions struct + Application string + CustomHeaders map[string]string + DeliveryTimeoutMs *int + Description *string + Environment string + MaxAttempts *int + RetrySchedule []int + Secret *string + Subscriptions []Subscription + type Delivery struct + Attempts *int + CreatedAt *string + EndpointID string + EventID *string + EventType *string + Id string + Status string + UpdatedAt *string + type DrainOptions struct + BatchLimit int + MaxAttempts int + type DrainResult struct + Failed int + Remaining int + Sent int + type Endpoint struct + Application string + CreatedAt *string + CustomHeaders map[string]string + DeliveryTimeoutMs *int + Description *string + Environment string + Id string + MaxAttempts *int + RetrySchedule []int + Secret *string + Status string + Subscriptions []Subscription + URL string + UpdatedAt *string + type EnqueueOptions struct + Application string + Environment string + IdempotencyKey string + Source *string + type Error struct + Err error + Message string + func (e *Error) Error() string + func (e *Error) Unwrap() error + type Event struct + Application string + DeliveriesCreated int + Environment string + EventType string + EventUID string + Id string + Source *string + type FileStore struct + func NewFileStore(dir string) (*FileStore, error) + func (s *FileStore) Close() error + func (s *FileStore) ListPending(_ context.Context, limit int) ([]Record, error) + func (s *FileStore) MarkFailed(_ context.Context, id string, lastError *string, attempts int, ...) error + func (s *FileStore) MarkSent(_ context.Context, id string) error + func (s *FileStore) Save(_ context.Context, record Record) error + func (s *FileStore) Size(_ context.Context) (int, error) + type ListDeliveriesOptions struct + EndpointID string + EventType string + Limit *int + Offset *int + Q string + Since string + Status string + Until string + type ListEndpointsOptions struct + Environment string + Limit *int + Offset int + type MemoryStore struct + func NewMemoryStore() *MemoryStore + func (s *MemoryStore) Close() error + func (s *MemoryStore) ListPending(_ context.Context, limit int) ([]Record, error) + func (s *MemoryStore) MarkFailed(_ context.Context, id string, lastError *string, attempts int, ...) error + func (s *MemoryStore) MarkSent(_ context.Context, id string) error + func (s *MemoryStore) Save(_ context.Context, record Record) error + func (s *MemoryStore) Size(_ context.Context) (int, error) + type Option func(*Client) + func WithDrainBatchLimit(n int) Option + func WithHTTPClient(h *http.Client) Option + func WithMaxAttempts(n int) Option + func WithMaxRetries(n int) Option + func WithOnDead(fn func(Record)) Option + func WithStore(store Store) Option + func WithTimeout(d time.Duration) Option + type Page struct + Items []T + NextOffset *int + type Patch = map[string]any + type PublishOptions struct + Application string + Environment string + IdempotencyKey string + Source *string + type Record struct + Application string + Attempts int + CreatedAt time.Time + Environment string + EventType string + ID string + LastError *string + NextAttemptAt time.Time + Payload map[string]any + Source *string + type Store interface + Close func() error + ListPending func(ctx context.Context, limit int) ([]Record, error) + MarkFailed func(ctx context.Context, id string, lastError *string, attempts int, ...) error + MarkSent func(ctx context.Context, id string) error + Save func(ctx context.Context, record Record) error + Size func(ctx context.Context) (int, error) + type Subscription struct + MatchKind string + Pattern string + type VerifyOptions struct + Now int64 + Timestamp *int64 + ToleranceSeconds int