GithubHelp home page GithubHelp logo

Comments (2)

skmcgrail avatar skmcgrail commented on September 15, 2024

The Smithy code-generator currently doesn't have an opinionated structure on how endpoints are set or determined for a client. So the base generated client does not generate or register middleware that sets the endpoint. We have a pair GoIntegration plugin on the the SDK side that has an opinionated approach to endpoints (EndpointResolver type that takes a name of a region and returns an SDK specific endpoint structure describing a resolved endpoint). We then have our generated code based on the service's endpoints description and create a resolver and middleware that queries the endpoint and sets the endpoint for the underlying transport.

See AwsEndpointGenerator and EndpointGenerator for more in depth detail on how we are doing the code generation. ResolveEndpoint is an example of the generated middleware for the service client.

For the SDK's use case we needed to have a per client endpoint resolver and middleware due to our push to move away from a giant endpoints structure, and instead ship endpoints alongside the clients themselves. Depending on your use case you likely don't need this level of complexity.

from smithy-go.

lucix-aws avatar lucix-aws commented on September 15, 2024

I would note that smithy-go now supports modeled endpoint resolution, though the feature isn't part of the public IDL docs. That aside I have #458 open to track making smithy-go usable on its own, as of this writing it heavily depends on additional codegen support added in the v2 SDK to produce a working client.

from smithy-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.