std

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Overview

Package std provides an engine implementation backed by net/http.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

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

Bridge implements http.Handler, bridging net/http requests to stream.Handler.

func (*Bridge) ServeHTTP

func (b *Bridge) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP converts an http.Request to a stream.Stream, calls the handler, and writes the response.

type Engine

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

Engine wraps net/http.Server to implement the engine.Engine interface.

func New

func New(cfg resource.Config, handler stream.Handler) (*Engine, error)

New creates a new StdEngine.

func (*Engine) Addr

func (e *Engine) Addr() net.Addr

Addr returns the bound listener address. Returns nil if not yet listening.

func (*Engine) Listen

func (e *Engine) Listen(ctx context.Context) error

Listen starts the server and blocks until the context is canceled or an error occurs.

func (*Engine) Metrics

func (e *Engine) Metrics() engine.EngineMetrics

Metrics returns a snapshot of engine metrics.

func (*Engine) Shutdown

func (e *Engine) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server.

func (*Engine) Type

func (e *Engine) Type() engine.EngineType

Type returns the engine type.

Jump to

Keyboard shortcuts

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