transport

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package transport defines the transport-agnostic Message and Channel types that carry request and response payloads between a transport and a processing pipeline.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	ID     string
	In     chan *Message
	Out    chan *Message
	Ctx    context.Context
	Cancel context.CancelFunc
}

Channel is a transport-agnostic processing context. One Channel services one request (sync HTTP) or many messages (future batch).

Channel direction: In and Out are sized from the pipeline's perspective. The pipeline READS from In and WRITES to Out. The transport adapter writes inbound payloads to In and reads response payloads from Out.

func NewChannel

func NewChannel(parent context.Context, id string, inBuf, outBuf int) *Channel

NewChannel constructs a Channel with caller-controlled buffer sizes. inBuf is typically 1 (one inbound message per sync request); outBuf should be large enough to absorb streaming chunks without blocking the upstream reader (e.g., 64).

The Channel takes ownership of its Ctx; callers should defer Cancel to release resources.

type Message

type Message struct {
	ID          string
	ParentID    string
	Body        []byte
	Headers     map[string]string
	Labels      map[string]string
	Attribution map[string]string
	ReceivedAt  time.Time
}

Message is the canonical packet that flows through Relay. It is transport-agnostic and payload-type-agnostic. There are NO transport flags (no Stream, no protocol field) and NO payload-shape flags (no Model, no provider-specific field). Anything OpenAI-shape or Ollama-shape is extracted by handlers from Body into locals.

Jump to

Keyboard shortcuts

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