Documentation
¶
Overview ¶
Package dbus is the contract of the SDK's message bus client (kitsunium/sdk#737, ADR 0214's S0e amendment): the codes its refusals carry, range 0.3.108.*, declared here at the engine's path (ADR 0160).
The engine is internal/service/proc/dbus: a connection to a D-Bus daemon over a unix socket, written on the standard library — the authentication AUTH EXTERNAL, the messages the bus driver answers (Hello, AddMatch, GetNameOwner, RequestName, ReleaseName) and the NameOwnerChanged signal. It is what proc/service's Type=dbus watches a BusName= through; nothing here dials a socket.
Package dbus — the sentinels the engine refuses with. Each var's name equals its Reason in SCREAMING_SNAKE form; none quotes a message's body in its Public or Private half.
Index ¶
Constants ¶
const CodeAddressInvalid errs.Code = 0x00_03_6C_01 // 0.3.108.1
CodeAddressInvalid identifies a bus address the client cannot use: one that does not parse, or whose every entry names a transport other than a unix socket path or abstract name — tcp, nonce-tcp, unixexec, launchd and autolaunch are refused, never tried.
const CodeAuthRefused errs.Code = 0x00_03_6C_03 // 0.3.108.3
CodeAuthRefused identifies a bus that refused the connection's authentication: AUTH EXTERNAL, the kernel naming the connecting user.
const CodeBusUnreachable errs.Code = 0x00_03_6C_02 // 0.3.108.2
CodeBusUnreachable identifies a bus whose socket could not be connected, or that hung up before the connection was ready.
const CodeCallCancelled errs.Code = 0x00_03_6C_06 // 0.3.108.6
CodeCallCancelled identifies a call whose context was cancelled before its reply came; the reply, if it comes, is dropped.
const CodeCallFailed errs.Code = 0x00_03_6C_05 // 0.3.108.5
CodeCallFailed identifies a call the bus answered with an error; the error field names it (org.freedesktop.DBus.Error.AccessDenied, say).
const CodeCallTimeout errs.Code = 0x00_03_6C_09 // 0.3.108.9
CodeCallTimeout identifies a call the bus did not answer in time: within the context's deadline, or within 25 seconds — sd-bus's and libdbus's default reply timeout — when the context has none or a later one. The authentication is bounded the same.
const CodeConnClosed errs.Code = 0x00_03_6C_07 // 0.3.108.7
CodeConnClosed identifies a call or a watch on a connection that was closed, or that the bus hung up meanwhile.
const CodeNameInvalid errs.Code = 0x00_03_6C_08 // 0.3.108.8
CodeNameInvalid identifies a name that is not a well-known bus name: at least two elements separated by dots, each of [A-Za-z0-9_-] and not opening with a digit, no longer than the specification allows; a unique name (":1.42") is not one.
const CodeProtocolViolation errs.Code = 0x00_03_6C_04 // 0.3.108.4
CodeProtocolViolation identifies a bus that broke the protocol: a line of the authentication or a message header the specification does not allow, a header past its bound, a reply whose body is not of its signature. The connection is closed.
Variables ¶
var ( // AddressInvalid refuses a bus address the client cannot use. AddressInvalid = errs.Static(CodeAddressInvalid, "ADDRESS_INVALID", "The message bus address is not usable", "service/proc/dbus: the address does not parse, or names no unix socket path or abstract name; the address field says which", 0, 78) // BusUnreachable reports a bus whose socket could not be connected. BusUnreachable = errs.Static(CodeBusUnreachable, "BUS_UNREACHABLE", "The message bus is unreachable", "service/proc/dbus: the socket could not be connected, or the bus hung up during the handshake; the cause is in the chain", 0, 69) // AuthRefused reports a bus that refused the connection's authentication. AuthRefused = errs.Static(CodeAuthRefused, "AUTH_REFUSED", "The message bus refused the connection", "service/proc/dbus: the bus answered REJECTED to AUTH EXTERNAL; the mechanisms field lists what it offers", 0, 77) // ProtocolViolation reports a bus that broke the protocol; the rule field // says how, and the connection is closed. ProtocolViolation = errs.Static(CodeProtocolViolation, "PROTOCOL_VIOLATION", "The message bus broke the protocol", "service/proc/dbus: an authentication line, a header or a reply body the specification does not allow; the rule field says which", 0, 76) // CallFailed reports a call the bus answered with an error. CallFailed = errs.Static(CodeCallFailed, "CALL_FAILED", "The message bus refused the call", "service/proc/dbus: the bus answered the call with an error message; the method and error fields say which", 0, 0) // CallCancelled reports a call whose context was cancelled before its reply. CallCancelled = errs.Static(CodeCallCancelled, "CALL_CANCELLED", "The message bus call was cancelled", "service/proc/dbus: the caller's context was cancelled before the reply came; the method field says which call", 0, 0) // ConnClosed reports a call or a watch on a closed connection. ConnClosed = errs.Static(CodeConnClosed, "CONN_CLOSED", "The message bus connection is closed", "service/proc/dbus: the connection was closed, or the bus hung up, before the call was answered", 0, 69) // CallTimeout reports a call the bus did not answer in time. CallTimeout = errs.Static(CodeCallTimeout, "CALL_TIMEOUT", "The message bus did not answer in time", "service/proc/dbus: no reply within the context's deadline or 25 seconds, the default reply timeout; the method field says which call", 0, 75) // NameInvalid refuses a name that is not a well-known bus name. NameInvalid = errs.Static(CodeNameInvalid, "NAME_INVALID", "The bus name is not valid", "service/proc/dbus: the name is empty, unique, too long, or has an element that is empty, opens with a digit or holds a byte outside [A-Za-z0-9_-]; the name field says which", 0, 64) )
Functions ¶
This section is empty.
Types ¶
This section is empty.