streamgate

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package streamgate tracks whether a streaming response committed its first byte to the client. Failover across credentials or models is only allowed before that point; afterwards the stream belongs to one upstream and ends with its error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

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

Writer wraps an io.Writer and records whether any byte was written.

func New

func New(dst io.Writer) *Writer

New wraps dst. A nil dst is kept nil-safe: writes report an error.

func (*Writer) Unwrap

func (g *Writer) Unwrap() io.Writer

Unwrap returns the wrapped writer.

func (*Writer) Write

func (g *Writer) Write(p []byte) (int, error)

Write forwards p to the wrapped writer and latches the written flag when at least one byte flows through, even if an error is also reported.

func (*Writer) Written

func (g *Writer) Written() bool

Written reports whether any byte reached the client.

Jump to

Keyboard shortcuts

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