Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
Addresses: #242
Ahead of the TTS WS release, we temporarily placed the TTS WS implementation at
pkg/api/speak-stream
andpkg/client/speak-stream
in this PR: #239 to avoid a naming collision between the REST and WebSocket implementation. This PR puts the package in a more thought-out and permanent location before we release the feature.This looks like a lot, but I tried to commit
git mv
so that it can keep track of these changes easier. In most cases, it seems to have done a decent job. In other cases, it seems to have not done so well. The overwhelming majority of the other changes include fixing things with static checks, moving things, and so on.pkg/client
ChangesBecause the clients were NOT versioned, this enabled the process to do that. To demonstrate the approach for
clients
on this PR, the following changes were made to the clients.The way it was before:
The files were moved into a
pkg/client/<type>/v1
folder and thepkg/client/<type>
created backward-compatible links to artifacts in these newv1
folders.pkg/api
ChangesThe
pkg/api
were versioned, but we need to change theapi
s so thatspeak
makes a lot more sense. We don't want aspeak
andspeak-stream
API package. The implementation of TTS WS was done purposely so that this change could be made easily. These changes then follow the client in a similar fashion.The way it was before:
The files were moved into a
pkg/api/<type>v1
folder and thepkg/client/<type>
created backward-compatible links to artifacts in these newv1
folders.The README was updated to keep the idea of Live/Stream and PreRecorded, but when it goes out to code, it maps to
listen/rest
andlisten/websocket
. The same is true forspeak
.The users' code should remain unchanged, but now hint that there are deprecated packages in use to be removed at the next major release. This is what it will look like in the IDE/editor by way of a strikethrough (picture below) and this warning in the deprecated packages:
Any examples with the name
new-RENAME
(for example:examples/text-to-speech/rest/file-new-RENAME/hello-world/main.go
) is using the new package names as to demonstrate the deprecated and new ways can both coexist.Other notable changes:
PackageVersion
was placed on all API and Client packageslive
->listenv1ws
.TODOs:
examples
other than renaming the folders to demonstrate the backward compatibility of these changes. In a follow-up PR, I will change all the examples to be implement without using these deprecated package references so people are set on the right path on how to use the packages in this repo.Types of changes
What types of changes does your code introduce to the community Go SDK?
Put an
x
in the boxes that applyChecklist
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.Further comments
NA