-
Notifications
You must be signed in to change notification settings - Fork 54
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
Setup Go Server codegen #494
Conversation
7d82b5a
to
94fe8a4
Compare
@@ -49,6 +50,10 @@ default byte getOrder() { | |||
return 0; | |||
} | |||
|
|||
default ArtifactType getArtifactType() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible for a plugin to work for either artifact type? What's this used for?
@@ -70,7 +71,8 @@ | |||
* <p>Reserved words for Go are automatically escaped so that they are | |||
* suffixed with "_". See "reserved-words.txt" for the list of words. | |||
*/ | |||
final class SymbolVisitor implements SymbolProvider, ShapeVisitor<Symbol> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - is this really a SymbolVisitor or a ShapeVisitor?
@@ -79,8 +80,10 @@ final class CodegenVisitor extends ShapeVisitor.Default<Void> { | |||
LOGGER.info("Attempting to discover GoIntegration from the classpath..."); | |||
ServiceLoader.load(GoIntegration.class, loader) | |||
.forEach(integration -> { | |||
LOGGER.info(() -> "Adding GoIntegration: " + integration.getClass().getName()); | |||
integrations.add(integration); | |||
if (integration.getArtifactType().equals(ArtifactType.CLIENT)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any kind of future refactoring that removes the need to add these kinds of conditionals inside of codegen?
|
||
@Override | ||
public void execute(PluginContext context) { | ||
String onlyBuild = System.getenv("SMITHY_GO_BUILD_API"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is going on here? Feels like this needs a comment at least.
protocolDocumentGenerator = new ProtocolDocumentGenerator(settings, model, writers); | ||
|
||
// TODO(SSDK): do we need this? | ||
this.eventStreamGenerator = new EventStreamGenerator(settings, model, writers, symbolProvider, service); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW we probably won't get to event streams in our current scope
|
||
public interface ProtocolGenerator { | ||
@SmithyInternalApi | ||
public interface ServerProtocolGenerator { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a reason we moved this?
383eb2e
to
8819a05
Compare
The branch
feat-svcgen
should NOT be merged into main; everything in the branch is a POC.Issue #, if available:
N/A.
Description of changes:
Setup Go Server codegen
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.