{"modulePath":"github.com/uber/submitqueue","version":"v0.3.0-20261125210437-add1a4bd2ea2","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package conduit\n\nPackage conduit calls Phabricator's Conduit API: it encodes a method's parameters, authenticates the call and decodes Conduit's result envelope.\n\nIt holds one generic Call and no per-method wrappers. Each caller keeps its own typed requests and results and decides what a missing object means for it, so a method only one caller uses never lands here.\n\nThe API token travels inside the JSON parameters, as \"\\_\\_conduit\\_\\_.token\". Conduit ignores an \"api.token\" field once the parameters are JSON, so auth cannot be left to a transport the way it is for other HTTP APIs.\n\n## Types\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient calls Conduit methods with one API token. It is safe for concurrent use.\n\n```go\nfunc NewClient(httpClient *http.Client, token string) *Client\n```\nNewClient wraps httpClient, which must resolve relative paths against the Phabricator host (e.g. via platform/http.BaseURLTransport) and carries the caller's timeout and connection limits. token authenticates every call.\n\n```go\nfunc (c *Client) Call(ctx context.Context, method string, params, result any) error\n```\nCall invokes method with params, which must encode as a JSON object (nil sends none), and decodes the result into result unless it is nil. A non-200 reply is a \\*platform/http.StatusError and a Conduit error\\_code is an \\*Error. A null result, or an empty array (PHP's encoding of an empty map), leaves result untouched.\n\n```go\ntype Error struct {\n\t// Code is Conduit's error_code, e.g. ERR-INVALID-SESSION.\n\tCode string\n\t// Info is Conduit's error_info, a human-readable description.\n\tInfo string\n}\n```\nError is a failure Conduit reports in its result envelope. Conduit answers such failures, including a missing or invalid token (ERR-INVALID-SESSION), with HTTP 200, so they never surface as a platform/http.StatusError.\n\n```go\nfunc (e *Error) Error() string\n```\n\n","path":"github.com/uber/submitqueue/platform/conduit","name":"conduit","synopsis":"Package conduit calls Phabricator's Conduit API: it encodes a method's parameters, authenticates the call and decodes Conduit's result envelope.","isRedistributable":true}
