transportdial

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package transportdial provides a convenience factory for creating a transport.Transport from environment variables.

This is the recommended quick-start path for most applications. Advanced users who need TLS, custom connection pools, or other low-level NATS options should construct nats.New / inmem.New directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(ctx context.Context, opts ...Option) (transport.Transport, error)

Dial creates a Transport from environment variables.

Env vars:

  • OPENAGENTIO_TRANSPORT: "nats" (default) or "inmem"
  • NATS_URL: NATS server URL, default "nats://localhost:4222"

Example:

tp, err := transportdial.Dial(ctx, transportdial.WithNATSName("echo-agent"))

Types

type Option

type Option func(*options)

Option configures Dial.

func WithNATSName

func WithNATSName(name string) Option

WithNATSName sets the NATS connection name. Only used when OPENAGENTIO_TRANSPORT=nats (or default).

Jump to

Keyboard shortcuts

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