Help us shape the future of Go! Take the 2026 Go Developer Survey

sdkwire

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 64 Imported by: 0

Documentation

Overview

Package sdkwire calls AWS service APIs through the Smithy schema-driven protocol codecs, taking and returning JSON-shaped values, so callers need no generated SDK client.

Clients whose pinned version ships a schemas package use it directly, except those nothing else links (modeledServices in cmd/sfnschemagen), which load an embedded copy of the graph (models/) so the package's init cost and ~4 MB of code stay out of the binary; the rest use models extracted from their generated clients (legacy/). After an SDK bump run `go run ./cmd/sfnschemagen` and then `go run ./cmd/ccwiregen` (the Cloud Control wire structs in internal/app) from the repo root; parity tests in this package check every operation against the real clients.

Index

Constants

View Source
const TimeLayout = "2006-01-02T15:04:05.000Z"

TimeLayout is how timestamps appear in Step Functions task output.

Variables

View Source
var (
	// ErrUnknownOp is returned for an operation the service does not define.
	ErrUnknownOp = errors.New("unknown AWS SDK action")
	// ErrEventStream is returned for operations that stream events.
	ErrEventStream = errors.New("event stream operations are not supported")
)
View Source
var ErrBadValue = errors.New("invalid parameter value")

ErrBadValue marks a parameter that does not fit its schema.

Functions

func Keys

func Keys() []string

Keys lists the registered service keys.

Types

type Op

type Op struct {
	Schema *smithy.OperationSchema
	// Token names the idempotency-token member the SDK fills when absent.
	Token string
	// Sanitize names input members the SDK cuts to their last "/" segment.
	Sanitize []string
}

Op is one service operation.

type Service

type Service struct {
	Protocol smithyhttp.ClientProtocol
	Ops      map[string]*Op
	// Headers are sent on every request, as the SDK's service customizations do.
	Headers     map[string]string
	SigningName string
	// UserAgentAPI is the "api/<service>#<version>" SDK marker routers key on.
	UserAgentAPI string
}

Service describes one AWS service's wire protocol and operations.

func Lookup

func Lookup(key string) (*Service, bool)

Lookup returns the service registered under key.

func (*Service) Call

func (s *Service) Call(ctx context.Context, tgt Target, op string, params any) (any, error)

Call invokes operation op (e.g. "SendMessage") with Step Functions style params and returns the response as a JSON-shaped value. Service errors come back as *awshttp.ResponseError wrapping a smithy.APIError.

type Target

type Target struct {
	Handler     http.Handler
	Credentials aws.CredentialsProvider
	Endpoint    string
	Region      string
	// Account is sent as X-Amz-Account-Id; empty for the default account.
	Account string
}

Target is where and as whom a call is made.

Directories

Path Synopsis
Package ir is the wire model of a service whose SDK client predates schema-based serde: shapes, members and operations with the names and bindings their protocol puts on the wire.
Package ir is the wire model of a service whose SDK client predates schema-based serde: shapes, members and operations with the names and bindings their protocol puts on the wire.
Package schemair is a serialized form of an SDK service's smithy-go schema graph, so the graph can be rebuilt on first use instead of by the SDK schemas package's init functions.
Package schemair is a serialized form of an SDK service's smithy-go schema graph, so the graph can be rebuilt on first use instead of by the SDK schemas package's init functions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL