examples/

directory
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: Apache-2.0

README

Harbor examples

Runnable, worked examples of the Harbor runtime SDK. Everything here builds and is exercised by CI (go test ./examples/... in the examples job) — a drift in a public surface that breaks an example fails the build.

For step-by-step how-to guides, see docs/recipes/.

Layout

examples/
├── README.md              this file
├── harbor.yaml            annotated reference configuration
├── dev.yaml               `harbor dev` loop configuration
├── agents/
│   └── echo/              worked harbortest.Agent + test
└── tools/
    └── weather/           worked in-process tool registration + test

Example configs

File Purpose
harbor.yaml Annotated reference config covering every top-level section. Copy and adapt.
dev.yaml The canonical harbor dev config. Copy to harbor.yaml at your project root.

Validate either with the in-tree config validator:

harbor validate ./examples/harbor.yaml

Example agents

agents/echo/EchoAgent implements the public harbortest.Agent interface (the same interface harbor scaffold produces) and is driven end-to-end by harbortest.RunOnce. Copy the package, keep the interface satisfaction and the compile-time assertion, and replace Run's body with your agent's real logic.

Example tools

tools/weather/ — registers a Go function as a Harbor in-process tool via inproc.RegisterFunc. The driver derives JSON Schemas from the typed input/output structs and wraps the function in the ToolPolicy reliability shell. The test shows the full register → resolve → invoke round-trip.

Running the examples

# Build everything under examples/.
go build ./examples/...

# Run the worked-example tests.
go test ./examples/...

Directories

Path Synopsis
agents
echo
Package echo is a worked, runnable Harbor agent example.
Package echo is a worked, runnable Harbor agent example.
tools
weather
Package weather is a worked, runnable example of registering a Go function as a Harbor in-process tool.
Package weather is a worked, runnable example of registering a Go function as a Harbor in-process tool.

Jump to

Keyboard shortcuts

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