{"id":19503786,"url":"https://github.com/goh-chunlin/go-onedrive","last_synced_at":"2025-04-09T22:19:35.315Z","repository":{"id":47478493,"uuid":"312184682","full_name":"goh-chunlin/go-onedrive","owner":"goh-chunlin","description":"This is a Golang client library for accessing the Microsoft OneDrive REST API.","archived":false,"fork":false,"pushed_at":"2023-04-21T02:28:24.000Z","size":117,"stargazers_count":102,"open_issues_count":1,"forks_count":15,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T20:09:15.532Z","etag":null,"topics":["go","golang","microsoft-graph","onedrive-client"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/goh-chunlin/go-onedrive","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/goh-chunlin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-12T06:14:10.000Z","updated_at":"2025-03-29T21:20:33.000Z","dependencies_parsed_at":"2024-06-18T15:34:42.173Z","dependency_job_id":"ddf4d91c-96b4-4bf6-a6ef-d4e261fab07f","html_url":"https://github.com/goh-chunlin/go-onedrive","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goh-chunlin%2Fgo-onedrive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goh-chunlin%2Fgo-onedrive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goh-chunlin%2Fgo-onedrive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goh-chunlin%2Fgo-onedrive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goh-chunlin","download_url":"https://codeload.github.com/goh-chunlin/go-onedrive/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119553,"owners_count":21050788,"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":["go","golang","microsoft-graph","onedrive-client"],"created_at":"2024-11-10T22:22:59.368Z","updated_at":"2025-04-09T22:19:35.296Z","avatar_url":"https://github.com/goh-chunlin.png","language":"Go","funding_links":["https://www.buymeacoffee.com/chunlin"],"categories":[],"sub_categories":[],"readme":"# go-onedrive\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://gclstorage.blob.core.windows.net/images/go-onedrive-banner.png\" /\u003e\n\u003c/div\u003e\n\n![Go Build](https://github.com/goh-chunlin/go-onedrive/workflows/Go%20Build/badge.svg?branch=main)\n![CodeQL Scan](https://github.com/goh-chunlin/go-onedrive/workflows/CodeQL%20Scan/badge.svg?branch=main)\n[![Go Report Card](https://goreportcard.com/badge/github.com/goh-chunlin/go-onedrive)](https://goreportcard.com/report/github.com/goh-chunlin/go-onedrive)\n[![Go Reference](https://pkg.go.dev/badge/github.com/goh-chunlin/go-onedrive.svg)](https://pkg.go.dev/github.com/goh-chunlin/go-onedrive)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![Donate](https://img.shields.io/badge/$-donate-ff69b4.svg)](https://www.buymeacoffee.com/chunlin)\n\ngo-onedrive is a Golang client library for accessing the [Microsoft OneDrive REST API](https://docs.microsoft.com/en-us/onedrive/developer/rest-api/?view=odsp-graph-online).\n\nThis project is inspired by a few open-source projects, especially the [go-github project from Google](https://github.com/google/go-github).\n\nCurrently, **go-onedrive requires Golang version 1.15 or greater**.  go-onedrive tracks [Golang version support policy](https://golang.org/doc/devel/release.html#policy). I'll do my best not to break older versions of Golang if I don't have to, but due to tooling constraints, I don't always test older versions.\n\n## Getting Started ##\n\nModule support was introduced in Go 1.15. Starting from Go 1.16, module-aware mode is enabled by default. Hence, I'll assume the module-aware mode is enabled when using this library.\n\nIn the go.mod file, please make sure the correct package with the correct version is used.\n\n```\n...\n\nrequire (\n\tgithub.com/goh-chunlin/go-onedrive v1.1.1\n\t...\n)\n```\n\nThe current latest version should be **v1.1.1** (updated on **17th July 2021**, as shown on the [Releases page](https://github.com/goh-chunlin/go-onedrive/releases)).\n\nIn other go source files, you can then import the go-onedrive library as follows.\n```go\nimport \"github.com/goh-chunlin/go-onedrive/onedrive\"\n```\n\nConstruct a new OneDrive client, then use the various services on the client to access different parts of the OneDrive API. For example:\n\n```go\nctx := context.Background()\nts := oauth2.StaticTokenSource(\n\t\u0026oauth2.Token{AccessToken: \"...\"},\n)\ntc := oauth2.NewClient(ctx, ts)\n\nclient := onedrive.NewClient(tc)\n\n// list all OneDrive drives for the current logged in user\ndrives, err := client.Drives.List(ctx)\n```\n\nNOTE: Using the [context](https://godoc.org/context) package, one can easily pass cancelation signals and deadlines to various services of the client for handling a request. In case there is no context available, then `context.Background()` can be used as a starting point.\n\n## Authentication ##\n\nThe go-onedrive library does not directly handle authentication. Instead, when creating a new client, pass an `http.Client` that can handle authentication for you. The easiest and recommended way to do this is using the [oauth2](https://github.com/golang/oauth2)\nlibrary.\n\nNote that when using an authenticated Client, all calls made by the client will\ninclude the specified OAuth token. Therefore, authenticated clients should\nalmost never be shared between different users.\n\nSee the [oauth2 docs](https://godoc.org/golang.org/x/oauth2) for complete instructions on using that library.\n\n## Contributing ##\n\nThis library is being initially developed as a library for my personal project as listed below.\n- [Lunar.Music.Web](https://github.com/goh-chunlin/Lunar.Music.Web).\n\nHence, API methods will likely be implemented in the order that they are needed by my personal project. However, I still welcome you to contribute to this project to support the following features.\n\n- [x] General\n\t- [x] Async job to track progress\n    - [x] Search\n- [x] Drives\n\t- [x] Get default drive\n\t- [x] Get individual drive\n\t- [x] List all available drives\n- [x] Folders\n    - [x] Create\n\t- [x] Copy\n\t- [x] Delete\n\t- [x] List children (items)\n    - [x] Move\n    - [x] Rename\n\t- [x] Create share link to a folder and its content\n\t- [x] List share links of a folder\n- [x] Items\n\t- [x] Get individual item\t\n\t- [x] Copy\n\t- [x] Delete\n    - [x] Move\n    - [x] Rename\t\n\t- [x] Create share link to an item\n\t- [x] Delete share link (or permission) of an item\n\t- [x] List share links of an item\n    - [x] Upload simple item size \u003c 4MB\n    - [x] Upload and then replace with item size \u003c 4MB\n    - [x] Upload large item without additional retry attempts\n\n## Sensei Projects ##\n\nSpecial thanks go to the following projects for providing useful references which help me in the development of this library.\n- [google/go-github](https://github.com/google/go-github);\n- [ggordan/go-onedrive](https://github.com/ggordan/go-onedrive);\n- [googleapis/google-api-go-client](https://github.com/googleapis/google-api-go-client).\n\n## License ##\n\nThis library is distributed under the GPL-3.0 License found in the [LICENSE](./LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoh-chunlin%2Fgo-onedrive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoh-chunlin%2Fgo-onedrive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoh-chunlin%2Fgo-onedrive/lists"}