frontend

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertifyFrontend

func CertifyFrontend(ctx context.Context, h FrontendHarness) (semantic.Certification, error)

CertifyFrontend selects and records scenarios for one frontend harness.

Types

type CapturingExecutor

type CapturingExecutor struct {
	Calls  []*lipapi.Call
	Script EventScript
}

CapturingExecutor intercepts canonical calls and supplies scripted event streams.

func (*CapturingExecutor) CancelALeg

func (*CapturingExecutor) Execute

func (e *CapturingExecutor) Execute(ctx context.Context, call *lipapi.Call) (lipapi.EventStream, error)

Execute captures the canonical call and returns a scripted stream.

func (*CapturingExecutor) WallClock

func (e *CapturingExecutor) WallClock() func() time.Time

type EventScript

type EventScript struct {
	Events []lipapi.Event
	Err    error
	Stream func(context.Context) lipapi.EventStream
}

EventScript contains scripted canonical events to feed back to a frontend under test.

type FrontendHarness

type FrontendHarness interface {
	Subject() semantic.SubjectDescriptor
	Frontend(ctx context.Context) (FrontendView, error)
	Executor() *CapturingExecutor
	Reset() error
}

FrontendHarness provides the test harness interface for frontend certification.

type FrontendView

type FrontendView interface {
	ServeHTTP(w http.ResponseWriter, req *http.Request)
	Subject() semantic.SubjectDescriptor
	Probe(ctx context.Context, scenario semantic.ScenarioDescriptor, executor *CapturingExecutor) (semantic.ExecutionEvidence, error)
}

FrontendView is a test interface for driving a frontend wire handler.

type FrontendViewDecorator

type FrontendViewDecorator func(FrontendView) FrontendView

FrontendViewDecorator lets protocol-specific contract tests add probes without making the generic harness own protocol or transport orchestration.

type MountedHarness

type MountedHarness struct {
	Descriptor           semantic.SubjectDescriptor
	Mount                lipsdk.FrontendMount
	Path                 func(semantic.ScenarioDescriptor) string
	Body                 func(semantic.ScenarioDescriptor) []byte
	NegativeBody         func(semantic.ScenarioDescriptor) []byte
	Decorate             FrontendViewDecorator
	ExecutorBoundary     *CapturingExecutor
	ContinuationStore    lipcont.Store
	ContinuationResolver lipcont.Resolver
	// AuthProvider is applied as the real outer transport middleware. This keeps
	// protocol frontends that do not own auth behind the same boundary as the
	// standard distribution, while OpenResponses also receives the authenticated
	// context when its direct mount requires auth.
	AuthProvider httpauth.Provider
	Mux          *http.ServeMux
	Handler      http.Handler
}

MountedHarness adapts any frontend mount to the common TCK without importing a concrete frontend or backend. Request paths and bodies are supplied by the frontend contribution, keeping protocol-owned wire details at the edge.

func (*MountedHarness) Executor

func (h *MountedHarness) Executor() *CapturingExecutor

func (*MountedHarness) Frontend

func (*MountedHarness) Reset

func (h *MountedHarness) Reset() error

func (*MountedHarness) Subject

Jump to

Keyboard shortcuts

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