server

package
v0.0.21 Latest Latest
Warning

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

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

Documentation

Overview

Package server builds the ServerTransport from config: an unserved stub (the default) or Connect over net/http. The concrete backends live in the stub/ and connect/ subpackages; the contract is interfaces.ServerTransport.

Index

Constants

View Source
const (
	// KindStub registers handlers on a mux it never serves (the default).
	KindStub = client.KindStub

	// KindConnect serves Connect RPC over net/http.
	KindConnect client.Kind = "connect"
)

Variables

This section is empty.

Functions

func NewFromConfig

func NewFromConfig(
	ctx context.Context,
	cfg Config,
	deps Deps,
) (interfaces.ServerTransport, error)

NewFromConfig builds the server transport cfg.Kind selects, without I/O. An unknown kind is CodeInvalidInput.

Types

type Config

type Config struct {
	// Kind selects the backend; empty means KindStub.
	Kind client.Kind `yaml:"kind" mapstructure:"kind"`

	// Connect configures KindConnect.
	Connect connect.ServerConfig `yaml:"connect" mapstructure:"connect"`
}

Config selects and tunes the server transport.

type Deps

type Deps struct {
	// Logger reports server lifecycle events.
	Logger interfaces.Logger
}

Deps carries the transport's runtime collaborators.

Directories

Path Synopsis
Package stub is the zero-infrastructure ServerTransport: handlers register on a mux that is never served, so a graph boots and its routes can be exercised in process (httptest) without opening a port.
Package stub is the zero-infrastructure ServerTransport: handlers register on a mux that is never served, so a graph boots and its routes can be exercised in process (httptest) without opening a port.

Jump to

Keyboard shortcuts

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