{"id":17289847,"url":"https://github.com/noahgorstein/go-stardog","last_synced_at":"2025-03-26T18:24:14.069Z","repository":{"id":41160518,"uuid":"502064749","full_name":"noahgorstein/go-stardog","owner":"noahgorstein","description":"Go library for interacting with Stardog","archived":false,"fork":false,"pushed_at":"2023-08-15T16:09:57.000Z","size":1462,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-31T23:46:05.655Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noahgorstein.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":"2022-06-10T14:02:45.000Z","updated_at":"2023-01-12T14:23:06.000Z","dependencies_parsed_at":"2023-02-14T03:25:23.317Z","dependency_job_id":null,"html_url":"https://github.com/noahgorstein/go-stardog","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahgorstein%2Fgo-stardog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahgorstein%2Fgo-stardog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahgorstein%2Fgo-stardog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noahgorstein%2Fgo-stardog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noahgorstein","download_url":"https://codeload.github.com/noahgorstein/go-stardog/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245709993,"owners_count":20659811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-10-15T10:36:16.972Z","updated_at":"2025-03-26T18:24:14.045Z","avatar_url":"https://github.com/noahgorstein.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-stardog\n\n![go-stardog](https://user-images.githubusercontent.com/23270779/175647530-ae5a8681-87a6-471d-a03a-4c700610483d.jpg)\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/noahgorstein/go-stardog.svg)](https://pkg.go.dev/github.com/noahgorstein/go-stardog) \n[![Go Report Card](https://goreportcard.com/badge/github.com/noahgorstein/go-stardog)](https://goreportcard.com/report/github.com/noahgorstein/go-stardog)\n![Coverage](https://img.shields.io/badge/Coverage-98.7%25-brightgreen)\n\n\ngo-stardog is a Go client library for interacting with a Stardog server.\n\n## Usage\n\nUsage:\n\n\n```go\nimport \"github.com/noahgorstein/go-stardog/stardog\"\n```\n\nConstruct a new Stardog client, then use the various services on the client to\naccess different parts of the Stardog API. For example:\n\n```go\nctx := context.Background()\n\nbasicAuthTransport := stardog.BasicAuthTransport{\n  Username: \"admin\",\n  Password: \"admin\",\n}\n\nclient, _ := stardog.NewClient(\"http://localhost:5820\", basicAuthTransport.Client())\n\n// list all users in the server\nusers, _, err := client.User.List(ctx)\n```\n\nThe services of a client divide the API into logical chunks and roughly correspond to structure of the [Stardog HTTP API documentation](https://stardog-union.github.io/http-docs/)\n\n\u003e **Note**\u003cbr\u003e\n\u003e Using the https://godoc.org/context package, one can easily\n\u003e pass cancelation signals and deadlines to various services of the client for\n\u003e handling a request. In case there is no context available, then `context.Background()`\n\u003e can be used as a starting point.\n\nFor more sample code snippets, head over to the [examples](https://github.com/noahgorstein/go-stardog/tree/main/examples) directory.\n\n## Authentication\n\nThe go-stardog library does not directly handle authentication. Instead, when\ncreating a new client, pass an `http.Client` that can handle authentication for\nyou.\n\n### Basic Authentication\n\nFor users who wish to authenticate via username and password (HTTP Basic Authentication), use the `BasicAuthTransport`:\n\n```go\nfunc main() {\n\n  ctx := context.Background()\n\n  basicAuthTransport := stardog.BasicAuthTransport{\n    Username: \"admin\",\n    Password: \"admin\",\n  }\n\n  client, _ := stardog.NewClient(\"http://localhost:5820\", basicAuthTransport.Client())\n\n  // list all users in the server\n  users, _, err := client.User.List(ctx)\n}\n```\n\n### Token Authentication\n\nFor users who wish to authenticate via an access token (Bearer Authentication), use the `BearerAuthTransport`:\n\n```go\nfunc main() {\n\n  ctx := context.Background()\n\n  bearerAuthTransport := stardog.BearerAuthTransport{\n    BearerToken: \"...token...\",\n  }\n\n  client, _ := stardog.NewClient(\"http://localhost:5820\", bearerAuthTransport.Client())\n\n  // list all users in the server\n  users, _, err := client.User.List(ctx)\n}\n```\n\n## Notes\n\n- This library is being actively worked on and is unstable. \n- This library is **not** officially maintained by Stardog.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoahgorstein%2Fgo-stardog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoahgorstein%2Fgo-stardog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoahgorstein%2Fgo-stardog/lists"}