Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 2.1 KB

File metadata and controls

52 lines (38 loc) · 2.1 KB

Usage

简体中文 | Docs Index

Requirements

  • Go 1.25 or newer, matching the module go directive.
  • A Gnalloy application, recipe, example, or benchmark harness that owns lifecycle and deployment configuration.
  • Standalone module verification should set GOWORK=off so the module is tested through its published dependency graph.

Install

go get gnalloy.org/examples@dev

Import

import "gnalloy.org/examples"

Integration Pattern

  • Configure bind addresses, target addresses, payload sizes, duration, concurrency, and protocol options from command-line flags or environment-specific wrappers.
  • Treat examples as executable documentation; production services should own their own configuration schema.

API Selection

Use the API inventory to choose the exact constructor or option type for your protocol path:

go doc gnalloy.org/examples

Common current entry points:

  • var ErrInvalidProtocol = errors.New("gnalloy/examples: invalid bench protocol") ...
  • type Config struct{ ... }
  • var ErrInvalidBackend = errors.New("gnalloy/examples: invalid backend") ...
  • type Options struct{ ... }
  • var ErrInvalidProtocol = errors.New("gnalloy/examples: invalid smoke protocol") ...
  • type Config struct{ ... }
  • const ProtocolBoth stressclient.Protocol = "both"
  • var ErrLeakDetected = errors.New("gnalloy/examples: stress leak detected") ...
  • type Config struct{ ... }
  • var ErrInvalidProtocol = errors.New("gnalloy/examples: invalid stress protocol") ...
  • type Config struct{ ... }

Cross-Module Assembly

When multiple Gnalloy repositories are developed together, create a local go.work file in your chosen workspace. Keep application-local replace directives out of published library modules unless the change is intentionally temporary and never committed.

Error Handling

Network input, peer behavior, platform capability, and timeout failures must be handled as normal errors. Do not recover protocol correctness by panicking. Return or propagate the module error and close the affected Channel when ownership requires it.