e2ehooks

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package e2ehooks provides utilities for end-to-end testing of hooks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleJSON

func HandleJSON(m map[string]any) http.Handler

func HandleSuccess

func HandleSuccess() http.Handler

Types

type Hook

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

func NewHook

func NewHook(name v0hooks.Name) *Hook

func (*Hook) ClearCalls

func (o *Hook) ClearCalls()

func (*Hook) GetCalls

func (o *Hook) GetCalls() []*HookCall

func (*Hook) ServeHTTP

func (o *Hook) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Hook) SetHandler

func (o *Hook) SetHandler(hr http.Handler)

type HookCall

type HookCall struct {
	Header http.Header
	Body   string
	Dump   string
}

func (*HookCall) Unmarshal

func (o *HookCall) Unmarshal(v any) error

type HookRecorder

type HookRecorder struct {
	BeforeUserCreated    *Hook
	AfterUserCreated     *Hook
	CustomizeAccessToken *Hook
	MFAVerification      *Hook
	PasswordVerification *Hook
	SendEmail            *Hook
	SendSMS              *Hook
	// contains filtered or unexported fields
}

func NewHookRecorder

func NewHookRecorder() *HookRecorder

func (*HookRecorder) Register

func (o *HookRecorder) Register(
	hookCfg *conf.HookConfiguration,
	baseURL string,
)

func (*HookRecorder) ServeHTTP

func (o *HookRecorder) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Instance

type Instance struct {
	*e2eapi.Instance

	HookServer   *httptest.Server
	HookRecorder *HookRecorder
}

func New

func New(globalCfg *conf.GlobalConfiguration) (*Instance, error)

func (*Instance) Close

func (o *Instance) Close() error

Jump to

Keyboard shortcuts

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