http

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 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 AuthConfig

type AuthConfig struct {
	Type AuthType `json:"type"`
	// API Key settings
	APIKey     string `json:"apiKey,omitempty"`
	APIKeyName string `json:"apiKeyName,omitempty"` // Header name for API key
	// Basic auth settings
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
	// OAuth2/Bearer settings
	Token        string `json:"token,omitempty"`
	TokenFile    string `json:"tokenFile,omitempty"`    // Path to token file
	ClientID     string `json:"clientId,omitempty"`     // OAuth2 client ID
	ClientSecret string `json:"clientSecret,omitempty"` // OAuth2 client secret
	TokenURL     string `json:"tokenUrl,omitempty"`     // OAuth2 token endpoint
	Scopes       string `json:"scopes,omitempty"`       // OAuth2 scopes
	// GCP Service Account settings
	ServiceAccountFile string `json:"serviceAccountFile,omitempty"`
	// AWS IAM settings
	AWSRegion          string `json:"awsRegion,omitempty"`
	AWSAccessKeyID     string `json:"awsAccessKeyId,omitempty"`
	AWSSecretAccessKey string `json:"awsSecretAccessKey,omitempty"`
	// Cloudflare settings
	CloudflareToken string `json:"cloudflareToken,omitempty"`
	CloudflareKey   string `json:"cloudflareKey,omitempty"`
	CloudflareEmail string `json:"cloudflareEmail,omitempty"`
}

AuthConfig holds authentication configuration

type AuthType

type AuthType string

AuthType represents supported authentication methods

const (
	AuthTypeNone       AuthType = "none"
	AuthTypeAPIKey     AuthType = "apikey"
	AuthTypeBearer     AuthType = "bearer"
	AuthTypeBasic      AuthType = "basic"
	AuthTypeOAuth2     AuthType = "oauth2"
	AuthTypeGCPSA      AuthType = "gcp_service_account"
	AuthTypeAWSIAM     AuthType = "aws_iam"
	AuthTypeCloudflare AuthType = "cloudflare"
)

type EndpointConfig

type EndpointConfig struct {
	Headers map[string]string `json:"headers,omitempty"`
	URL     string            `json:"url"`
	Method  string            `json:"method,omitempty"`
}

EndpointConfig represents configuration for a single endpoint

type PeerHTTP

type PeerHTTP struct {
	pipeline.Peer
	// contains filtered or unexported fields
}

PeerHTTP implements HTTP webhook functionality

func (*PeerHTTP) Connect

func (p *PeerHTTP) Connect(config json.RawMessage, args ...any) error

Connect initializes the HTTP client with the provided configuration

func (*PeerHTTP) Disconnect

func (p *PeerHTTP) Disconnect() error

func (*PeerHTTP) Pub

func (p *PeerHTTP) Pub(event cdc.Event, args ...any) error

Pub sends the CDC event as a webhook to configured endpoints

func (*PeerHTTP) Sub

func (p *PeerHTTP) Sub(args ...any) (<-chan cdc.Event, error)

func (*PeerHTTP) Type

func (p *PeerHTTP) Type() pipeline.ConnectorType

type RetryConfig

type RetryConfig struct {
	MaxRetries  int           `json:"maxRetries"`
	InitialWait time.Duration `json:"initialWait"`
	MaxWait     time.Duration `json:"maxWait"`
}

RetryConfig holds retry settings for failed webhook attempts

Jump to

Keyboard shortcuts

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