{"id":37102165,"url":"https://github.com/rtfb/gonduit","last_synced_at":"2026-01-14T12:23:05.889Z","repository":{"id":57590472,"uuid":"146567101","full_name":"rtfb/gonduit","owner":"rtfb","description":"A Go package for connecting to Phabricator via the Conduit API.","archived":false,"fork":true,"pushed_at":"2018-08-29T11:14:46.000Z","size":84,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-07-11T18:11:56.201Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"uber/gonduit","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rtfb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-29T08:10:08.000Z","updated_at":"2023-07-11T18:11:56.201Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rtfb/gonduit","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"purl":"pkg:github/rtfb/gonduit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtfb%2Fgonduit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtfb%2Fgonduit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtfb%2Fgonduit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtfb%2Fgonduit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rtfb","download_url":"https://codeload.github.com/rtfb/gonduit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtfb%2Fgonduit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T12:23:05.128Z","updated_at":"2026-01-14T12:23:05.873Z","avatar_url":"https://github.com/rtfb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gonduit [![GoDoc](https://godoc.org/github.com/etcinit/gonduit?status.svg)](https://godoc.org/github.com/etcinit/gonduit)\n\nA Go client for interacting with [Phabricator](http://phabricator.org) via the [Conduit](https://secure.phabricator.com/book/phabdev/article/conduit/) API.\n\n## Getting started\n\n### Installing the library\n\nA simple `go get` should do it:\n\n```\ngo get github.com/etcinit/gonduit\n```\n\nFor reproducible builds, you can also use [Glide](https://glide.sh/).\n\n### Authentication\n\nGonduit supports the following authentication methods:\n\n- tokens\n- session\n\n\u003e If you are creating a bot/automated script, you should create a bot account\n\u003e on Phabricator rather than using your own.\n\n#### `tokens`: Getting a conduit API token\n\nTo get an API token, go to\n`https://{PHABRICATOR_URL}/settings/panel/apitokens/`. From there, you should be\nable to create and copy an API token to use with the client.\n\n#### `session`: Getting a conduit certificate\n\nTo get a conduit certificate, go to\n`https://{PHABRICATOR_URL}/settings/panel/conduit`. From there, you should be\nable to copy your certificate.\n\n## Basic Usage\n\n### Connecting\n\nTo construct an instance of a Gonduit client, use `Dial` with the URL of your\ninstall and an options object. `Dial` connects to the API, checks compatibility,\nand finally creates a Client instance:\n\n```go\nclient, err := gonduit.Dial(\n\t\"https://phabricator.psyduck.info\",\n\t\u0026core.ClientOptions{\n\t\tAPIToken: \"api-SOMETOKEN\"\n\t}\n)\n```\n\nWhile certificate-based/session authentication is being deprecated in favor of\nAPI tokens, Gonduit still supports certificates in case you are using an older\ninstall. After calling `Dial`, you will also need to call `client.Connect` to\ncreate a session. The session key will be stored in the client itself and it\nwill automatically be passed on on every subsequent request.\n\n```go\nclient, err := gonduit.Dial(\n\t\"https://phabricator.psyduck.info\",\n\t\u0026core.ClientOptions{\n\t\tCert: \"CERTIFICATE\",\n\t\tCertUser: \"USERNAME\",\n\t}\n)\n\nerr = client.Connect()\n```\n\n### Errors\n\nAny conduit error response will be returned as a `core.ConduitError` type:\n\n```go\nclient, err := gonduit.Dial(\n\t\"https://phabricator.psyduck.info\",\n\t\u0026core.ClientOptions{\n\t\tAPIToken: \"api-SOMETOKEN\"\n\t}\n)\n\nce, ok := err.(*core.ConduitError)\nif ok {\n\tprintln(\"code: \" + ce.Code())\n\tprintln(\"info: \" + ce.Info())\n}\n\n// Or, use the built-in utility function:\nif core.IsConduitError(err) {\n\t// do something else\n}\n```\n\n### Supported Calls\n\nAll the supported API calls are available in the `Client` struct. Every\nfunction is named after the Conduit method they call: For `phid.query`, we have\n`Client.PHIDQuery`. The same applies for request and responses:\n`requests.PHIDQueryRequest` and `responses.PHIDQueryResponse`.\n\nAdditionally, every general request method has the following signature:\n\n```go\nfunc (c *Conn) ConduitMethodName(req Request) (Response, error)\n```\n\nSome methods may also have specialized functions, you should refer the GoDoc\nfor more information on how to use them.\n\n#### List of supported calls:\n\n- conduit.connect\n- conduit.query\n- differential.query\n- diffusion.querycommit\n- file.download\n- macro.creatememe\n- maniphest.query\n- maniphest.createtask\n- maniphest.gettasktransactions\n- paste.create\n- paste.query\n- phid.lookup\n- phid.query\n- phriction.info\n- project.query\n- remarkup.process\n- repository.query\n- user.query\n\n## Arbitrary calls\n\nIf you need to call an API method that is not supported by this client library,\nyou can use the `client.Call` method to make arbitrary calls.\n\nYou will need to provide a struct with the request body and a struct for the\nresponse. The request has to be able to be able to be serialized into JSON,\nand the response has be able to be unserialized from JSON.\n\nRequest structs **must** also \"extend\" the `requests.Request` struct, which\ncontains additional fields needed to authenticate with Conduit.\n\n```go\ntype phidLookupRequest struct {\n\tNames   []string         `json:\"names\"`\n\trequests.Request // Includes __conduit__ field needed for authentication.\n}\n\ntype phidLookupResponse map[string]*struct{\n\tURI      string `json:\"uri\"`\n\tFullName string `json:\"fullName\"`\n\tStatus   string `json:\"status\"`\n}\n\nreq := \u0026phidLookupRequest {\n\tNames: []string{\"T1\"},\n\tSession: client.Session,\n}\nvar res phidLookupResponse\n\nerr := client.Call(\"phid.lookup\", req, \u0026res)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtfb%2Fgonduit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtfb%2Fgonduit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtfb%2Fgonduit/lists"}