smithy-go icon indicating copy to clipboard operation
smithy-go copied to clipboard

Examples or documentation would be appreciated

Open jabalsad opened this issue 3 years ago • 4 comments

Hello!

I'm interested in using smithy-go. Some examples or documentation would be very much appreciated. Thanks :)

jabalsad avatar Jun 04 '21 20:06 jabalsad

I'm in the same boat!

aknuds1 avatar Jun 28 '21 06:06 aknuds1

I've since figured out a few basics: you can build and install the plugin yourself by:

make smithy-publish-local

This should create a package located at: "$HOME/.m2/repository/software/amazon/smithy/go/smithy-go-codegen/0.1.0/smithy-go-codegen-0.1.0.pom

You then need to configure smith-build.json to output go:

    "go-codegen": {
      "service": "my.service#MyService",
      "module": "github.com/my/module"
    },

Lastly you need to add a dependency in the build.gradle.kts:

dependencies {
   ...
    implementation("software.amazon.smithy.go:smithy-go-codegen:0.1.0")
}

I also added it as a buildscript dependency though I'm not really sure how gradle works or what i'm doing.

jabalsad avatar Jun 28 '21 23:06 jabalsad

Does anyone here have examples of usage of generated API client code? I'm trying to use it now, but not sure how to configure the address of the API server.

aknuds1 avatar Jul 01 '21 09:07 aknuds1

Does anyone here have examples of usage of generated API client code? I'm trying to use it now, but not sure how to configure the address of the API server.

I'm glad its not just me I thought I was going crazy. Any sort of real basic quick start would be super helpful.

awlsring avatar Sep 24 '22 17:09 awlsring

You then need to configure smith-build.json to output go:

    "go-codegen": {
      "service": "my.service#MyService",
      "module": "github.com/my/module"
    },

I'd like to note that this should be nested under plugins:

"plugins": {
    "go-codegen": {
       "service": "my.service#MyService",
       "module": "github.com/my/module"
    }
}

FuzzyStatic avatar Apr 03 '23 15:04 FuzzyStatic

On its own smithy-go isn't usable its in current state - we need to at the very least move the protocol generators out of the SDK into this project (#458). I've updated the README to reflect this.

lucix-aws avatar Oct 03 '23 17:10 lucix-aws