server

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package server hosts the Ferret Wire protocol over caller-supplied listeners and a caller-configured Unified API runtime.

Runtime aliases the canonical github.com/MontFerret/api.Runtime interface accepted by NewServer. The host retains ownership of its implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limits

type Limits struct {
	MaxConnections                int
	MaxPlansPerConnection         int
	MaxSessionsPerConnection      int
	MaxExecutionsPerConnection    int
	MaxDebugSessionsPerConnection int
	MaxWatchersPerResource        int
	MaxBreakpointsPerDebugSession int
	MaxInboundMessageBytes        int
	MaxOutboundMessageBytes       int
}

Limits bounds all client-controlled resource and message classes. A custom value replaces the complete default set and every field must be positive.

func DefaultLimits

func DefaultLimits() Limits

DefaultLimits returns the secure finite limits used by NewServer.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures a Server without transferring host ownership.

func WithLimits

func WithLimits(limits Limits) Option

WithLimits replaces the complete default limit set. NewServer rejects the option when any resource or message limit is not positive.

func WithRuntimeIdentity

func WithRuntimeIdentity(identity RuntimeIdentity) Option

WithRuntimeIdentity publishes optional host application identity during the Connect handshake. Name is required; Wire does not derive identity from the process or environment.

type RuntimeIdentity

type RuntimeIdentity struct {
	Name       string
	Version    string
	InstanceID string
}

RuntimeIdentity is optional host-supplied handshake metadata. Wire does not derive it from the runtime implementation or process environment.

type Server

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

Server hosts Ferret Wire over a caller-supplied listener. It borrows the runtime passed to NewServer and never closes it.

func NewServer

func NewServer(runtime api.Runtime, options ...Option) (*Server, error)

NewServer adapts a caller-configured runtime without taking ownership or creating a listener. Limits default to DefaultLimits.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, listener net.Listener) error

Serve serves the caller-owned listener until it fails, ctx is cancelled, or Shutdown is called. NewServer and package initialization never open a listener.

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown cancels every logical connection before gracefully stopping gRPC. A deadline forces the gRPC server to stop, while cleanup continues once for all concurrent callers.

Directories

Path Synopsis
internal
core
Package core owns Wire's logical resource lifetimes and protocol-neutral operations.
Package core owns Wire's logical resource lifetimes and protocol-neutral operations.
grpcserver
Package grpcserver translates Wire RPCs into core operations and sanitized protocol responses.
Package grpcserver translates Wire RPCs into core operations and sanitized protocol responses.
lifecycle
Package lifecycle coordinates retained teardown results and independently cancellable waiters.
Package lifecycle coordinates retained teardown results and independently cancellable waiters.
panicboundary
Package panicboundary contains panics raised by externally supplied implementations at an explicit call boundary.
Package panicboundary contains panics raised by externally supplied implementations at an explicit call boundary.

Jump to

Keyboard shortcuts

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