Documentation
¶
Overview ¶
Package platform implements the Spine HTTP v3 contract with fasthttp.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(options ...FastHTTPOption) spine.App
New creates a Spine application with the fasthttp platform.
func NewFactory ¶
func NewFactory(options ...FastHTTPOption) httpcontract.Factory
NewFactory prepares a factory without opening listeners or starting goroutines.
func Option ¶
func Option(options ...FastHTTPOption) spine.Option
Option connects the fasthttp factory to a Spine application.
Types ¶
type FastHTTPAdapter ¶
type FastHTTPAdapter struct {
// contains filtered or unexported fields
}
FastHTTPAdapter owns a managed server and tracks requests on both managed and external servers. Construct it through NewFactory; its zero value is invalid.
func (*FastHTTPAdapter) Handler ¶
func (s *FastHTTPAdapter) Handler() fasthttp.RequestHandler
Handler returns the same protected native entry point used by Serve. The caller owns the external fasthttp.Server and its shutdown.
func (*FastHTTPAdapter) Serve ¶
func (s *FastHTTPAdapter) Serve(listener net.Listener, options ...httpcontract.ServeOption) (serveErr error)
Serve owns the listener on every return path and may be called only once.
func (*FastHTTPAdapter) Shutdown ¶
func (s *FastHTTPAdapter) Shutdown(ctx context.Context) error
Shutdown starts cleanup once. Its context limits only this wait; cleanup continues and another caller may wait again with a new context.
func (*FastHTTPAdapter) StopAccepting ¶
func (s *FastHTTPAdapter) StopAccepting()
StopAccepting synchronously rejects new native entries with HTTP 503.
type FastHTTPOption ¶
type FastHTTPOption func(*factory)
FastHTTPOption configures the native request pipeline.
func WithMiddleware ¶
func WithMiddleware(middleware ...func(fasthttp.RequestHandler) fasthttp.RequestHandler) FastHTTPOption
WithMiddleware places the first middleware at the outside of the pipeline. Middleware constructors run once per adapter, after configuration validation.