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 ¶
- func Expose(method string) bool
- func ExposeUI(method string) bool
- func Key(err error) string
- func Listen(dataDir string, svc *core.Service, version string) (*rpc.Server, error)
- func ListenWith(dataDir string, svc *core.Service, opts ListenOptions) (*rpc.Server, error)
- func NewCodec() *rpc.Codec
- type Error
- type ListenOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Expose ¶
Expose picks the *core.Service methods callable by the full role: every exported one except hidden, uiOnly, and the test hooks (…ForTest).
func ExposeUI ¶ added in v1.36.0
ExposeUI picks the *core.Service methods callable by the ui role: everything Expose allows plus uiOnly.
func Key ¶ added in v1.20.1
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 ¶
Listen serves svc's exposed methods on <dataDir>/godwit.sock with external access enabled (see ListenWith).
func ListenWith ¶ added in v1.36.0
ListenWith serves svc's exposed methods on <dataDir>/godwit.sock (see rpc.Listen; the caller holds the owner lock). Errors go out through NewCodec; the UI and API tokens and svc's secrets are redacted from them and from the log. Sends, forwarding rules and grants by the full and ui roles and drafts by the mcp role are audited before they are dispatched (ui's under its own source, with no external-source gating); SetSettings widening MCPSend is audited atomically with the save under settingsMu.
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.
type ListenOptions ¶ added in v1.36.0
type ListenOptions struct {
Version string
External bool // allow RoleFull and RoleMCP connections and write api-token
UIStarted bool // see rpc.ServerOptions
}
ListenOptions configures ListenWith.