Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure SDK Based on Go Project Conventions #85

Conversation

dvonthenen
Copy link
Contributor

@dvonthenen dvonthenen commented Oct 19, 2023

Proposed changes

This restructures the project according to typical go conventions.

This implements the following:

  • Observe go conventions by placing packages into the pkg folder and break down modules by functionality
  • Moves client structs into pkg/client
    • Prerecorded Client (REST based) has moved to pkg/client/prerecorded
    • Live Client (Websocket-based) has moved to pkg/client/live
  • Moves all the management functionality into pkg/api/manage. These are functions like ListProjects, etc.
  • Prerecorded and Live examples located at examples/prerecorded and examples/streaming work as before
  • A new examples/projects was added to verify the move of the manage REST calls to pkg/api/manage. This implements an example to ListProjects on the DG Account
  • Updates the go test to consume the new structure. go tests pass like before.
  • Updated all READMEs to reflect the new changes.

NOTE: This PR restructures the project and updated any references to modules, struct variables and etc which captures the minimal changes needed for the restructure and nothing more. There is still some refactoring, obsoletion of dead code (due to just copying source files like types.go info other modules), etc, that need to be addressed. Those non-structural modifications will be done in a subsequent PR.

Types of changes

What types of changes does your code introduce to the community Go SDK?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ x] Documentation update or tests (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

go tests pass in the tests/ folder
example/prerecord works like before
example/streaming works like before
example/projects proves the manage module works after the restructure (calling ListProjects for example)

@jpvajda
Copy link
Contributor

jpvajda commented Oct 19, 2023

@dvonthenen Thanks for putting this PR up for review. I don't have a lot of comments on the code changes but could you setup a branch for the Go v1 SDK where we can merge these changes into? @lukeocodes did something like this with the Node SDK v3 https://github.com/deepgram/deepgram-node-sdk/tree/lo/node-sdk-v3. This way we can approve and merge these changes into a "feature" branch as you work in this.

@dvonthenen
Copy link
Contributor Author

@dvonthenen Thanks for putting this PR up for review. I don't have a lot of comments on the code changes but could you setup a branch for the Go v1 SDK where we can merge these changes into? @lukeocodes did something like this with the Node SDK v3 https://github.com/deepgram/deepgram-node-sdk/tree/lo/node-sdk-v3. This way we can approve and merge these changes into a "feature" branch as you work in this.

Will do! I will need to close and reopen against the new branch, so there will be another PR shortly.

@dvonthenen
Copy link
Contributor Author

Closing this PR in favor of this one:
#86

Which is a PR against the go-sdk-v1 branch which is the new branch for the upcoming v1 release.

@dvonthenen dvonthenen closed this Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants