{"id":16797096,"url":"https://github.com/jdockerty/onetimesecret-go","last_synced_at":"2025-03-17T03:44:46.852Z","repository":{"id":55395631,"uuid":"325949152","full_name":"jdockerty/onetimesecret-go","owner":"jdockerty","description":"Golang API client for OneTimeSecret","archived":false,"fork":false,"pushed_at":"2021-01-03T10:26:22.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T13:29:29.346Z","etag":null,"topics":["api-client","api-wrapper","go","golang","golang-api","onetimesecret"],"latest_commit_sha":null,"homepage":"","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/jdockerty.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":"2021-01-01T09:18:55.000Z","updated_at":"2021-01-03T10:26:21.000Z","dependencies_parsed_at":"2022-08-14T23:20:30.272Z","dependency_job_id":null,"html_url":"https://github.com/jdockerty/onetimesecret-go","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdockerty%2Fonetimesecret-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdockerty%2Fonetimesecret-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdockerty%2Fonetimesecret-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdockerty%2Fonetimesecret-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdockerty","download_url":"https://codeload.github.com/jdockerty/onetimesecret-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243971157,"owners_count":20376784,"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":["api-client","api-wrapper","go","golang","golang-api","onetimesecret"],"created_at":"2024-10-13T09:21:08.980Z","updated_at":"2025-03-17T03:44:46.831Z","avatar_url":"https://github.com/jdockerty.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OneTimeSecret (OTS) - Go Client Library\n\nThis serves as a Golang API client for [onetimesecret](https://onetimesecret.com/).\n\n## Installation\n\nAs this is a Go package, it is easiest to install via `go get`\n\nAs such, you can retrieve this package by running the command\n\n    go get -u \"github.com/jdockerty/onetimesecret-go/ots\"\n\n## Usage\n\nPrior to using the package, you must have an account with OTS as this gives you a username, which is your email, to use and an API token. Various functions are exposed which match to the naming conventions of the OTS API.\n\nA simple use case for checking the status of the OTS API and creating a secret is shown below\n```go\npackage main\n\nimport (\n    \"log\"\n    \"github.com/jdockerty/onetimesecret-go/ots\"\n)\n\nfunc main() {\n\n    client := ots.New(\"YOUR_EMAIL\", \"API_TOKEN\")\n    \n    err := client.Status() // Get the status of the OTS API\n    if err != nil {\n        return // If the API is offline, an error is returned.\n    }\n\n    // Send a secret to your friend's email address, it is destroyed within 60 seconds. \n    // They must enter the passphrase to view it.\n    secretResp, err := client.Create(\n\t\"my super secret value\", \n\t\"very secret passphrase\", \n\t\"bestfriend@gmail.com\",\n\t60)\n    if err != nil {\n\t// Handling errors from sending requests and dealing with JSON go here\n\tlog.Fatal(err) \n\t}\n\n    // Log the Secret struct response with various information to stdout in an easy to read format.\n    secretResp.PrettyPrint()\n\n}\n```\n\n\nThe other exported functions can return a `Secret` or `Secrets` type, which is struct that contains the expected responses from the API, such as a list of recipients for the secret or it's time-to-live value. Which fields are used is left to the user and further details on the various functions are available via the [godoc](https://godoc.org/github.com/jdockerty/onetimesecret-go/ots) page.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdockerty%2Fonetimesecret-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdockerty%2Fonetimesecret-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdockerty%2Fonetimesecret-go/lists"}