{"id":18383978,"url":"https://github.com/speakeasy-sdks/template-speakeasy-bar","last_synced_at":"2026-05-04T07:37:08.998Z","repository":{"id":204966770,"uuid":"713090518","full_name":"speakeasy-sdks/template-speakeasy-bar","owner":"speakeasy-sdks","description":"A template for the Speakeasy Bar starter SDK.","archived":false,"fork":false,"pushed_at":"2024-06-10T23:14:23.000Z","size":112,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-19T06:04:56.478Z","etag":null,"topics":["managed-sdk","openapi","openapi3","sdk","speakeasy-api","vendor-extensions"],"latest_commit_sha":null,"homepage":"https://speakeasyapi.dev/docs/using-speakeasy/create-client-sdks/intro/","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/speakeasy-sdks.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-01T20:21:37.000Z","updated_at":"2023-11-01T20:45:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"f55d0fcd-20b5-4dd0-ba2c-309c65a1c1ee","html_url":"https://github.com/speakeasy-sdks/template-speakeasy-bar","commit_stats":null,"previous_names":["speakeasy-sdks/template-speakeasy-bar"],"tags_count":6,"template":true,"template_full_name":null,"purl":"pkg:github/speakeasy-sdks/template-speakeasy-bar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-sdks%2Ftemplate-speakeasy-bar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-sdks%2Ftemplate-speakeasy-bar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-sdks%2Ftemplate-speakeasy-bar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-sdks%2Ftemplate-speakeasy-bar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/speakeasy-sdks","download_url":"https://codeload.github.com/speakeasy-sdks/template-speakeasy-bar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/speakeasy-sdks%2Ftemplate-speakeasy-bar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32599406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"online","status_checked_at":"2026-05-04T02:00:06.625Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["managed-sdk","openapi","openapi3","sdk","speakeasy-api","vendor-extensions"],"created_at":"2024-11-06T01:13:10.191Z","updated_at":"2026-05-04T07:37:08.972Z","avatar_url":"https://github.com/speakeasy-sdks.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Speakeasy Bar Starter SDK\n\n\u003cdiv align=\"left\"\u003e\n    \u003ca href=\"https://speakeasyapi.dev/\"\u003e\u003cimg src=\"https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge\u0026logoColor=FBE331\u0026logo=speakeasy\u0026labelColor=545454\" /\u003e\u003c/a\u003e\n    \n\u003c/div\u003e\n\n\u003cbr/\u003e\n\nThis is a sample SDK generated for the Speakeasy Bar API. Have a look around and familiarize yourself with the Speakeasy Product!\n\nWhen you're ready you can use this modify this repo to reference your own OpenAPI spec or go back to the Speakeasy app to complete onboarding and generate your first SDK!\n\n\n## 🏗 **Welcome to your new SDK!** 🏗\n\nIt has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps:\n- [ ] 🛠 Make your SDK feel handcrafted by [customizing it](https://www.speakeasyapi.dev/docs/customize-sdks)\n- [ ] ♻️ Refine your SDK quickly by iterating locally with the [Speakeasy CLI](https://github.com/speakeasy-api/speakeasy)\n- [ ] 🎁 Publish your SDK to package managers by [configuring automatic publishing](https://www.speakeasyapi.dev/docs/productionize-sdks/publish-sdks)\n- [ ] ✨ When ready to productionize, delete this section from the README\n\n\n### Local development\n\nOnce you have the SDK setup you may want to iterate on the SDK. Speakeasy supports OpenAPI vendor extensions that can be added to your spec to customize the SDK ergonomics (method names, namespacing resources etc.) and functionality (adding retries, pagination, multiple server support etc)\n\nTo get started install the Speakeasy CLI.\n\nIn your terminal, run:\n\n```bash\nbrew install speakeasy-api/homebrew-tap/speakeasy\n```\nOnce you annonate your spec with an extension you will want to run `speakeasy validate` to check the spec for correctness and `speakeasy generate` to recreate the SDK locally. More documentation on OpenAPI extensions [here](https://speakeasyapi.dev/docs/customize-sdks/namespaces/). Here's an example of adding a multiple server support to the spec so that your SDK supports production and sandbox versions of your API. The attached Makefile also attaches some helper commands.\n\n```yaml\ninfo:\n  title: Example\n  version: 0.0.1\nservers:\n  - url: https://prod.example.com # Used as the default URL by the SDK\n    description: Our production environment\n    x-speakeasy-server-id: prod\n  - url: https://sandbox.example.com\n    description: Our sandbox environment\n    x-speakeasy-server-id: sandbox\n```\n\nOnce you're finished iterating and happy with the output push only the latest version of spec into the repo and regenerate the SDK using step 6 above. \n\n\u003c!-- Start SDK Installation --\u003e\n## SDK Installation\n\n```bash\ngo get github.com/speakeasy-sdks/template-speakeasy-bar\n```\n\u003c!-- End SDK Installation --\u003e\n\n## SDK Example Usage\n\u003c!-- Start SDK Example Usage --\u003e\n```go\npackage main\n\nimport (\n\t\"context\"\n\ttemplatespeakeasybar \"github.com/speakeasy-sdks/template-speakeasy-bar\"\n\t\"github.com/speakeasy-sdks/template-speakeasy-bar/pkg/models/shared\"\n\t\"log\"\n)\n\nfunc main() {\n\ts := templatespeakeasybar.New(\n\t\ttemplatespeakeasybar.WithSecurity(\"\"),\n\t)\n\n\tvar drinkType *shared.DrinkType = shared.DrinkTypeSpirit\n\n\tctx := context.Background()\n\tres, err := s.Drinks.ListDrinks(ctx, drinkType)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif res.Drinks != nil {\n\t\t// handle response\n\t}\n}\n\n```\n\u003c!-- End SDK Example Usage --\u003e\n\n\u003c!-- Start SDK Available Operations --\u003e\n## Available Resources and Operations\n\n\n### [Authentication](docs/sdks/authentication/README.md)\n\n* [Authenticate](docs/sdks/authentication/README.md#authenticate) - Authenticate with the API by providing a username and password.\n\n### [Config](docs/sdks/config/README.md)\n\n* [SubscribeToWebhooks](docs/sdks/config/README.md#subscribetowebhooks) - Subscribe to webhooks.\n\n### [Drinks](docs/sdks/drinks/README.md)\n\n* [GetDrink](docs/sdks/drinks/README.md#getdrink) - Get a drink.\n* [ListDrinks](docs/sdks/drinks/README.md#listdrinks) - Get a list of drinks.\n\n### [Ingredients](docs/sdks/ingredients/README.md)\n\n* [ListIngredients](docs/sdks/ingredients/README.md#listingredients) - Get a list of ingredients.\n\n### [Orders](docs/sdks/orders/README.md)\n\n* [CreateOrder](docs/sdks/orders/README.md#createorder) - Create an order.\n\u003c!-- End SDK Available Operations --\u003e\n\n\u003c!-- Start Dev Containers --\u003e\n# Dev Containers\n\u003cdiv align=\"left\"\u003e\n    \u003ca href=\"https://codespaces.new/speakeasy-sdks/template-speakeasy-bar.git/tree/main\"\u003e\u003cimg src=\"https://github.com/codespaces/badge.svg\" /\u003e\u003c/a\u003e\n    \n\u003c/div\u003e\n\nExperience our SDK in an enhanced sandbox environment. Try it now in **GitHub Codespaces**!\n\n* [Explore Dev Containers](.devcontainer/README.md)\n\u003c!-- End Dev Containers --\u003e\n\n\u003c!-- Start Error Handling --\u003e\n# Error Handling\n\nHandling errors in your SDK should largely match your expectations.  All operations return a response object or an error, they will never return both.  When specified by the OpenAPI spec document, the SDK will return the appropriate subclass.\n\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\ttemplatespeakeasybar \"github.com/speakeasy-sdks/template-speakeasy-bar\"\n\t\"github.com/speakeasy-sdks/template-speakeasy-bar/pkg/models/operations\"\n\t\"github.com/speakeasy-sdks/template-speakeasy-bar/pkg/models/shared\"\n\t\"log\"\n)\n\nfunc main() {\n\ts := templatespeakeasybar.New(\n\t\ttemplatespeakeasybar.WithSecurity(\"\"),\n\t)\n\n\tctx := context.Background()\n\tres, err := s.Authentication.Authenticate(ctx, operations.AuthenticateRequestBody{})\n\tif err != nil {\n\n\t\tvar e *APIError\n\t\tif errors.As(err, \u0026e) {\n\t\t\t// handle error\n\t\t\tlog.Fatal(e.Error())\n\t\t}\n\n\t}\n}\n\n```\n\u003c!-- End Error Handling --\u003e\n\n\u003c!-- Start Server Selection --\u003e\n# Server Selection\n\n## Select Server by Name\n\nYou can override the default server globally using the `WithServer` option when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:\n\n| Name | Server | Variables |\n| ----- | ------ | --------- |\n| `prod` | `https://speakeasy.bar` | None |\n| `staging` | `https://staging.speakeasy.bar` | None |\n| `customer` | `https://{organization}.{environment}.speakeasy.bar` | `environment` (default is `prod`), `organization` (default is `api`) |\n\n\nSome of the server options above contain variables. If you want to set the values of those variables, the following options are provided for doing so:\n * `WithEnvironment ServerEnvironment`\n\n * `WithOrganization string`\n\nFor example:\n\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\ttemplatespeakeasybar \"github.com/speakeasy-sdks/template-speakeasy-bar\"\n\t\"github.com/speakeasy-sdks/template-speakeasy-bar/pkg/models/operations\"\n\t\"github.com/speakeasy-sdks/template-speakeasy-bar/pkg/models/shared\"\n\t\"log\"\n)\n\nfunc main() {\n\ts := templatespeakeasybar.New(\n\t\ttemplatespeakeasybar.WithSecurity(\"\"),\n\t\ttemplatespeakeasybar.WithServer(\"customer\"),\n\t)\n\n\tctx := context.Background()\n\tres, err := s.Authentication.Authenticate(ctx, operations.AuthenticateRequestBody{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif res.Authenticate200ApplicationJSONObject != nil {\n\t\t// handle response\n\t}\n}\n\n```\n\n\n## Override Server URL Per-Client\n\nThe default server can also be overridden globally using the `WithServerURL` option when initializing the SDK client instance. For example:\n\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\ttemplatespeakeasybar \"github.com/speakeasy-sdks/template-speakeasy-bar\"\n\t\"github.com/speakeasy-sdks/template-speakeasy-bar/pkg/models/operations\"\n\t\"github.com/speakeasy-sdks/template-speakeasy-bar/pkg/models/shared\"\n\t\"log\"\n)\n\nfunc main() {\n\ts := templatespeakeasybar.New(\n\t\ttemplatespeakeasybar.WithSecurity(\"\"),\n\t\ttemplatespeakeasybar.WithServerURL(\"https://speakeasy.bar\"),\n\t)\n\n\tctx := context.Background()\n\tres, err := s.Authentication.Authenticate(ctx, operations.AuthenticateRequestBody{})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif res.Authenticate200ApplicationJSONObject != nil {\n\t\t// handle response\n\t}\n}\n\n```\n\u003c!-- End Server Selection --\u003e\n\n\u003c!-- Start Custom HTTP Client --\u003e\n# Custom HTTP Client\n\nThe Go SDK makes API calls that wrap an internal HTTP client. The requirements for the HTTP client are very simple. It must match this interface:\n\n```go\ntype HTTPClient interface {\n\tDo(req *http.Request) (*http.Response, error)\n}\n```\n\nThe built-in `net/http` client satisfies this interface and a default client based on the built-in is provided by default. To replace this default with a client of your own, you can implement this interface yourself or provide your own client configured as desired. Here's a simple example, which adds a client with a 30 second timeout.\n\n```go\nimport (\n\t\"net/http\"\n\t\"time\"\n\t\"github.com/myorg/your-go-sdk\"\n)\n\nvar (\n\thttpClient = \u0026http.Client{Timeout: 30 * time.Second}\n\tsdkClient  = sdk.New(sdk.WithClient(httpClient))\n)\n```\n\nThis can be a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration.\n\u003c!-- End Custom HTTP Client --\u003e\n\n\u003c!-- Start Go Types --\u003e\n\n\u003c!-- End Go Types --\u003e\n\n\u003c!-- Placeholder for Future Speakeasy SDK Sections --\u003e\n\n# Development\n\n## Maturity\n\nThis SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage\nto a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally\nlooking for the latest version.\n\n## Contributions\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically.\nFeel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!\n\n### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspeakeasy-sdks%2Ftemplate-speakeasy-bar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspeakeasy-sdks%2Ftemplate-speakeasy-bar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspeakeasy-sdks%2Ftemplate-speakeasy-bar/lists"}