textapi

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package textapi shares bounded HTTP/SSE execution between text protocols. Each protocol owns its native response shape and streaming state machine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Index

func Index(value any) (int, bool)

Index validates provider-controlled indexes before any integer conversion.

func Number

func Number(value any) float64

func Object

func Object(value any) map[string]any

func Observe

func Observe(root map[string]any, text string, observation *testspec.Observation)

func String

func String(value any) string

Types

type Decoder

type Decoder interface {
	JSON(map[string]any, *testspec.Observation)
	Event(map[string]any, *testspec.Observation) (semantic, text, terminal bool)
	Finish(*testspec.Observation)
}

type Module

type Module struct {
	ID, Label, Path string
	DefaultBody     json.RawMessage
	Headers         map[string]string
	NewDecoder      func() Decoder
}

func (*Module) Descriptor

func (module *Module) Descriptor() runtime.Descriptor

func (*Module) Execute

func (module *Module) Execute(ctx context.Context, execution runtime.Execution) testspec.Observation

func (*Module) ValidateProtocol

func (module *Module) ValidateProtocol(spec testspec.Spec) error

Jump to

Keyboard shortcuts

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