Skip to content

docs: package overview and runnable Example functions for the pkg.go.dev landing page #83

Description

@ThomasK33

Once #69 is resolved, pkg.go.dev will render the GoDoc, but the root package's landing page will still be nearly empty:

  • doc.go is two lines ("Package chat provides a Go-native runtime for routing normalized chat events…").
  • The repository has no Example… test functions, so pkg.go.dev shows no runnable examples.

docs/reference.md states that the API reference is the GoDoc, so this is the main reference surface for users.

Proposal

  1. Expand the root doc.go into a package overview: the core model (adapter → event → thread → handler), a minimal construction snippet, dispatch modes, and pointers to docs/.
  2. Add a small number of Example functions in example_test.go, for instance:
    • Example — construct a runtime with memory state and register OnNewMention.
    • ExampleThread_Subscribe — subscribe on mention, reply in OnSubscribedMessage.
    • ExampleRuntimeOptions_deferred — enable DispatchDeferred with a DetachTimeout.
      They compile under go test (and go vet), so they cannot drift the way prose snippets can.
  3. Consider short package overviews for state/redis, state/postgres, and state/nats (currently one line each).

Acceptance

Found during the docs audit behind #80, #81, and #82.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions