Help us shape the future of Go! Take the 2026 Go Developer Survey

gateway

package
v0.19.13 Latest Latest
Warning

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

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

Documentation

Overview

Package gateway runs an agent's chat platforms as one process: the adapters and their ingress (polling or a webhook server) feed one at-least-once processor over local sessions, beside the fronts that drive the agent themselves. Its caller reads the environment and supplies the persistence (DECISIONS.md D27, "Team agents").

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorizer

func Authorizer(allowed string) (func(chat.Message) error, error)

Authorizer admits only the platform user IDs in allowed, a comma-separated list (ORB_CHAT_ALLOWED_SENDERS).

func Run

func Run(ctx context.Context, options Options) error

Run serves the platforms and fronts until one ends or ctx does.

func RunFronts

func RunFronts(ctx context.Context, fronts []func(context.Context) error, log io.Writer, close func(context.Context) error) error

RunFronts runs an agent's fronts until one ends or ctx does, stops the others, then closes; the ending front's error is the result, and an ended ctx is a clean stop.

func Webhook

func Webhook(platform, listen, path string, webhook func(func(chat.Message) error) http.Handler) func(context.Context, func(chat.Message) error) error

Webhook serves a platform's webhook on listen (default 127.0.0.1:8080) at path (default /<platform>, ORB_CHAT_PATH).

Types

type Options

type Options struct {
	// DataDir holds the gateway's sessions and, without Spool, its spool file.
	DataDir   string
	Adapters  []chat.Adapter
	Ingresses []func(context.Context, func(chat.Message) error) error
	// Fronts run beside the gateway (see RunFronts).
	Fronts    []func(context.Context) error
	Authorize func(chat.Message) error
	Provider  []chat.LocalProviderOption
	// Spool, when set, holds the queue instead of DataDir/spool.jsonl, and
	// the gateway then locks DataDir for this process.
	Spool chat.Spool
	Log   io.Writer
}

Jump to

Keyboard shortcuts

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