app

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	SpecPath    string
	Addr        string
	Profile     string
	ForceStatus int
	Slow        []string
	Fail        []string
	Timeout     []string
	Corrupt     []string
	Sequence    []string
	Overrides   map[string]interceptor.Override
}

Options reúne as configurações de um Runtime: caminho da spec, endereço de escuta, profile de execução, status forçado e comportamentos por endpoint (latência, falha, timeout, corrupção). Cada campo por endpoint aceita várias entradas no formato "path=valor"; sem "=", a entrada vale para todos.

type Runtime

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

Runtime guarda os endpoints carregados e os serve via HTTP.

func New

func New(opts Options) (*Runtime, error)

New carrega e valida a spec, descobre os endpoints, resolve o profile e devolve um Runtime pronto (sem iniciar o servidor). Retorna erro se a spec for inválida, não tiver endpoints ou o profile for desconhecido.

func (*Runtime) Run

func (r *Runtime) Run() error

Run inicia o servidor HTTP e bloqueia até ele parar.

Jump to

Keyboard shortcuts

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