rpcbind

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package rpcbind composes core with rpc: core's error codes, redaction and the methods exposed over the Local API. core does not depend on rpc.

Its error table is the only place an error's wire code and i18n key are written; the native UI and the pages show errors by Key.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expose

func Expose(method string) bool

Expose picks the *core.Service methods callable over RPC: every exported one but Close, Redact, AuditExternal, the avatars, the progress callbacks, FollowConversation (a channel and a stop func; RPC clients have SubscribeConversation) and the test hooks.

func Key added in v1.20.1

func Key(err error) string

Key is the i18n key of what err means to the user, by the first row it is; "" when it is none. The key may have no message in the catalog yet.

func Listen

func Listen(dataDir string, svc *core.Service, version string) (*rpc.Server, error)

Listen serves svc's exposed methods on <dataDir>/godwit.sock (see rpc.Listen; the caller holds the owner lock). Errors go out through NewCodec; the API token and svc's secrets are redacted from them and from the log. Sends by the full role and drafts by the mcp role are audited before they are dispatched.

func NewCodec

func NewCodec() *rpc.Codec

NewCodec registers core's error types (tried first, so *ai.Error with Code canceled stays an *ai.Error) and sentinels.

Types

type Error added in v1.20.1

type Error struct {
	Code string // "" when it does not cross the Local API
	Err  error
	Key  string // "" for "error." + Code
}

Error is a row of the table.

func All added in v1.20.1

func All() []Error

All is every row of the table.

Jump to

Keyboard shortcuts

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