forward

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package forward provides Forwarder implementations that deliver non-HTTP trigger actions to downstream systems. This package is an extension seam; callers wire it in via the triggers.Forwarder interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// URL is the bus endpoint every custom action is posted to. Required.
	URL string
	// Method defaults to POST when empty.
	Method string
	// StaticHeaders are extra request headers, applied after the fixed ones.
	StaticHeaders map[string]string
	// Client sends the requests; nil selects http.DefaultClient.
	Client *http.Client
}

Config is the HTTP bus forwarder's configuration.

type HTTP

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

HTTP posts every custom trigger action to a single bus endpoint.

func New

func New(cfg Config) (*HTTP, error)

New builds an HTTP bus forwarder. It returns an error when URL is empty or does not parse, or when Method is not a valid HTTP method token.

func (*HTTP) Forward

func (h *HTTP) Forward(ctx context.Context, realm, trigger string, action json.RawMessage, event []byte) error

Forward implements the triggers.Forwarder contract.

Jump to

Keyboard shortcuts

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