{"id":15510258,"url":"https://github.com/chelnak/onetimesecret-go","last_synced_at":"2025-03-28T19:17:49.990Z","repository":{"id":47057712,"uuid":"398364681","full_name":"chelnak/onetimesecret-go","owner":"chelnak","description":"A Go implementation of the onetimesecret.com api 🔒️","archived":false,"fork":false,"pushed_at":"2021-09-15T12:18:47.000Z","size":23,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-02T20:46:41.506Z","etag":null,"topics":["go-library","golang","secrets","security"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chelnak.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-08-20T18:14:47.000Z","updated_at":"2022-08-28T15:23:34.000Z","dependencies_parsed_at":"2022-09-14T05:42:22.792Z","dependency_job_id":null,"html_url":"https://github.com/chelnak/onetimesecret-go","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chelnak%2Fonetimesecret-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chelnak%2Fonetimesecret-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chelnak%2Fonetimesecret-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chelnak%2Fonetimesecret-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chelnak","download_url":"https://codeload.github.com/chelnak/onetimesecret-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246085645,"owners_count":20721213,"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-library","golang","secrets","security"],"created_at":"2024-10-02T09:47:17.156Z","updated_at":"2025-03-28T19:17:49.963Z","avatar_url":"https://github.com/chelnak.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Api Client for onetimesecret.com\n\n![onetimesecret](https://github.com/chelnak/onetimesecret-go/actions/workflows/main.yml/badge.svg) [![Go Report Card](https://goreportcard.com/badge/github.com/chelnak/onetimesecret-go)](https://goreportcard.com/report/github.com/chelnak/onetimesecret-go)\n\nThis is a Go implementation of the [onetimesecret.com api](https://onetimesecret.com/docs/api) api. The module aims to provide a developer friendly interface for all endpoints exposed by the api.\n\n## Installation\n\n```go\ngo get github.com/chelnak/onetimesecret-go\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n \"context\"\n \"fmt\"\n\n ots \"github.com/chelnak/onetimesecret-go/onetimesecret\"\n)\n\nfunc main() {\n\n // Build a new client\n client := ots.NewClient(\n  ots.WithUsername(\"otsuser@domain.com\"),\n  ots.WithAPIKey(\"xxxxxxxx\"),\n )\n\n // Send a request with context\n ctx := context.Background()\n response, err := client.GetStatus(ctx)\n if err != nil {\n  panic(err)\n }\n\n fmt.Println(response.Status)\n\n}\n```\n\n### Using a custom http.Client instance\n\n```go\npackage main\n\nimport (\n    ots \"github.com/chelnak/onetimesecret-go/onetimesecret\"\n    \"context\"\n)\n\nfunc main() {\n\n    // Create a custom http client instance\n    customHttpClient := \u0026http.Client{ ... }\n\n    // Build a new ots client and use WithHttpClient option\n    client := ots.NewClient(\n        ots.WithUsername(\"otsuser@domain.com\"),\n        ots.WithApiKey(\"xxxxxxxx\"),\n        ots.WithHttpClient(customHttpClient)\n    )\n\n    // Send a request with context\n    ctx := context.Background()\n    response, err := client.GetStatus(ctx)\n    if err != nil {\n        panic(err)\n    }\n\n    fmt.Println(response.Status)\n}\n```\n\n\u003e Note: By default, a default http.Client instance is used if one is not passed when creating a client instance.\n\nMore documentation can be found [here](https://pkg.go.dev/github.com/chelnak/onetimesecret-go).\n\n## Unit testing\n\n```go\ngo test -tags unit ./... -v\n```\n\n## Examples\n\n```go\nexport OTS_USERNAME=otsuser@domain.com\nexport OTS_APIKEY=xxxxx\n\ngo test -tags example ./... -v\n```\n\n## Releasing\n\nReleases are tag based. From the main branch do the following:\n\n```go\ngit tag -a vX.X.X -m \"Release vX.X.X some reason\"\ngit push --follow-tags\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchelnak%2Fonetimesecret-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchelnak%2Fonetimesecret-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchelnak%2Fonetimesecret-go/lists"}