http

package
v0.0.0-...-bda2491 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSignature = errors.New("invalid signature")
	ErrReplayedRequest  = errors.New("replayed request")
)

Functions

func SetSecretResolver

func SetSecretResolver(resolver secret.Resolver)

Types

type Config

type Config struct {
	Path            string            `json:"path,omitempty"`
	Secret          string            `json:"secret,omitempty"`
	SignatureScheme string            `json:"signatureScheme,omitempty"`
	SignatureHeader string            `json:"signatureHeader,omitempty"`
	TimestampHeader string            `json:"timestampHeader,omitempty"`
	MaxTimestampAge string            `json:"maxTimestampAge,omitempty"`
	ParamMapping    map[string]string `json:"paramMapping,omitempty"`
	DefaultParams   map[string]string `json:"defaultParams,omitempty"`
}

type HTTP

type HTTP struct {
	trigger.Trigger
	// contains filtered or unexported fields
}

func New

func New(t *models.Trigger, opts ...Option) (*HTTP, error)

func (*HTTP) ExtractWebhookParams

func (h *HTTP) ExtractWebhookParams(ctx context.Context, req *stdhttp.Request, body []byte) (map[string]string, error)

func (*HTTP) Fire

func (h *HTTP) Fire(ctx context.Context) error

func (*HTTP) FireWithParams

func (h *HTTP) FireWithParams(ctx context.Context, params map[string]string) error

func (*HTTP) ID

func (h *HTTP) ID() uuid.UUID

func (*HTTP) Listen

func (h *HTTP) Listen(ctx context.Context)

func (*HTTP) MergeParams

func (h *HTTP) MergeParams(params map[string]string) map[string]string

func (*HTTP) Path

func (h *HTTP) Path() string

type Option

type Option func(*HTTP)

func WithListJobs

func WithListJobs(fn func(context.Context, string) (models.Jobs, error)) Option

func WithNow

func WithNow(fn func() time.Time) Option

func WithRunJob

func WithRunJob(fn func(context.Context, *models.Job, map[string]string) error) Option

func WithSecretResolver

func WithSecretResolver(resolver secret.Resolver) Option

Jump to

Keyboard shortcuts

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