webhook

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package webhook implements an emitter that POSTs the evaluation results as JSON to an HTTP(S) endpoint. It is configured with a single value, the webhook URL, taken from its initstring (eg "webhook:https://example.com/hook").

Emitting is best-effort: a single POST is attempted with no retries. A non-2xx response or a transport error is returned to the publisher, which surfaces it without failing the evaluation.

Index

Constants

View Source
const TypeMoniker = "webhook"

TypeMoniker is the moniker used to select this emitter in an initstring.

Variables

This section is empty.

Functions

func Build

func Build(initString string) (publisher.Emitter, error)

Build constructs a webhook emitter from its init string, which is the full webhook URL (everything after the "webhook:" prefix).

Types

type Emitter

type Emitter struct {
	URL    string
	Client *http.Client
}

Emitter POSTs the evaluation results to URL.

func (*Emitter) Emit

func (e *Emitter) Emit(ctx context.Context, results papi.Results, _ ...publisher.EmitOpt) error

Emit marshals the results to JSON and POSTs them to the configured URL.

Jump to

Keyboard shortcuts

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