Help us shape the future of Go! Take the 2026 Go Developer Survey

webhooks

package
v1.44.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

Package webhooks owns guided webhook creation and webhook result guidance.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureTestRequest

func CaptureTestRequest(request *http.Request, next func(*http.Request) (*http.Response, error)) (*http.Response, error)

Capture the submitted request after flag, stdin, file and header resolution. The webhook JSON body uses WithRequestBody([]byte), whose SDK GetBody returns an independent reader. Never read stdin or the outgoing Body for presentation.

func Configure

func Configure(root *cli.Command, options CommandOptions)

Configure the existing API commands before subgroup cloning.

func ShowResult

func ShowResult(value gjson.Result, opts ResultOptions) (bool, error)

Keep complete result output separate from optional, quiet-aware next steps.

func ValidateRequestEvents added in v1.42.1

func ValidateRequestEvents(command *cli.Command, body []byte) error

ValidateRequestEvents checks resolved JSON after flags and input files merge. Reject the complete request rather than silently changing its subscriptions.

Types

type CommandOptions

type CommandOptions struct {
	PrepareDiscovery         func(*cli.Command) ([]option.RequestOption, error)
	DefaultRequestOptions    func(*cli.Command) []option.RequestOption
	WriteHint                func(context.Context, io.Writer, string) error
	ReadableTransportFailure func(*cli.Command, error) (string, bool)
}

CommandOptions supplies assembly-owned request and diagnostic policies. PrepareDiscovery and DefaultRequestOptions must be supplied when configuring commands. Options belong to each command invocation; this package keeps no mutable policy globals.

type CreateCanceledError

type CreateCanceledError struct{ Cause error }

Only a confirmed dispatch can produce this marker. The ordinary error presenter owns recovery output, so cancellation adds no synchronous writes.

func (*CreateCanceledError) Error

func (*CreateCanceledError) Error() string

func (*CreateCanceledError) Unwrap

func (e *CreateCanceledError) Unwrap() error

type ResultOptions

type ResultOptions struct {
	output.ReadableOptions
	WriteHint func(context.Context, io.Writer, string) error
}

ResultOptions describes one selected readable result and its optional diagnostics.

type WorkflowError

type WorkflowError struct {
	Message string
	Cause   error
}

Messages contain only local guidance. Causes retain status and identity; their possibly sensitive bodies or URLs never enter this message.

func (*WorkflowError) Error

func (e *WorkflowError) Error() string

func (*WorkflowError) Unwrap

func (e *WorkflowError) Unwrap() error

Jump to

Keyboard shortcuts

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