-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from speakeasy-sdks/speakeasy-sdk-regen-1698870875
chore: speakeasy sdk regeneration - Generate
- Loading branch information
Showing
8 changed files
with
145 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
<div align="center"> | ||
<a href="https://codespaces.new/speakeasy-sdks/template-speakeasy-bar.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a> | ||
</div> | ||
<br> | ||
|
||
> **Remember to shutdown a GitHub Codespace when it is not in use!** | ||
# Dev Containers Quick Start | ||
|
||
The default location for usage snippets is the `samples` directory. | ||
|
||
## Running a Usage Sample | ||
|
||
A sample usage example has been provided in a `root.go` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below. | ||
|
||
``` | ||
go run root.go | ||
``` | ||
|
||
## Generating Additional Usage Samples | ||
|
||
The speakeasy CLI allows you to generate more usage snippets. Here's how: | ||
|
||
- To generate a sample for a specific operation by providing an operation ID, use: | ||
|
||
``` | ||
speakeasy generate usage -s ./openapi.yaml -l go -i {INPUT_OPERATION_ID} -o ./samples | ||
``` | ||
|
||
- To generate samples for an entire namespace (like a tag or group name), use: | ||
|
||
``` | ||
speakeasy generate usage -s ./openapi.yaml -l go -n {INPUT_TAG_NAME} -o ./samples | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/go | ||
{ | ||
"name": "Go", | ||
"image": "mcr.microsoft.com/devcontainers/go:1-1.20-bullseye", | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"golang.go", | ||
"github.vscode-pull-request-github" // Github interaction | ||
], | ||
"settings": { | ||
"files.eol": "\n", | ||
"editor.formatOnSave": true, | ||
"go.buildTags": "", | ||
"go.toolsEnvVars": { | ||
"CGO_ENABLED": "0" | ||
}, | ||
"go.useLanguageServer": true, | ||
"go.testEnvVars": { | ||
"CGO_ENABLED": "1" | ||
}, | ||
"go.testFlags": [ | ||
"-v", | ||
"-race" | ||
], | ||
"go.testTimeout": "60s", | ||
"go.coverOnSingleTest": true, | ||
"go.coverOnSingleTestFile": true, | ||
"go.coverOnTestPackage": true, | ||
"go.lintTool": "golangci-lint", | ||
"go.lintOnSave": "package", | ||
"[go]": { | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": true | ||
} | ||
}, | ||
"gopls": { | ||
"usePlaceholders": false, | ||
"staticcheck": true, | ||
"vulncheck": "Imports" | ||
} | ||
} | ||
}, | ||
"codespaces": { | ||
"openFiles": [ | ||
".devcontainer/README.md" | ||
] | ||
} | ||
} | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# Install the speakeasy CLI | ||
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh | ||
|
||
# Setup samples directory | ||
rmdir samples || true | ||
mkdir samples | ||
|
||
# Go module commands | ||
go mod download | ||
go mod tidy | ||
|
||
# Generate starter usage sample with speakeasy | ||
speakeasy generate usage -s ./openapi.yaml -l go -o samples/root.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters