webhook

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client defines the Webhook client

func NewClient

func NewClient(cfg Config) *Client

NewClient initializes a new Webhook client

func (*Client) Send

func (c *Client) Send(ctx context.Context, logs []types.Log) error

Send pushes logs with retry logic

type Config

type Config struct {
	URL            string        `mapstructure:"url"`
	Secret         string        `mapstructure:"secret"`
	MaxAttempts    int           `mapstructure:"max_attempts"`
	InitialBackoff time.Duration `mapstructure:"initial_backoff"`
	MaxBackoff     time.Duration `mapstructure:"max_backoff"`
}

Config holds configuration for the Webhook client.

type Payload

type Payload struct {
	Timestamp int64       `json:"timestamp"`
	Logs      []types.Log `json:"logs"`
}

Payload defines the data structure sent via webhook to consumers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL