[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5136":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":15,"starSnapshotCount":15,"syncStatus":28,"lastSyncTime":29,"discoverSource":30},5136,"aws-sdk-go","aws\u002Faws-sdk-go","aws","This SDK has reached end-of-support. The AWS SDK for Go v2 is available here: https:\u002F\u002Fgithub.com\u002Faws\u002Faws-sdk-go-v2","",null,"Go",8688,2041,5,0,3,40.93,"Apache License 2.0",true,false,"main",[7,23,24],"aws-sdk","go","2026-06-12 02:01:08","# AWS SDK for Go\n\n[![API Reference](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fapi-reference-blue.svg)](https:\u002F\u002Fdocs.aws.amazon.com\u002Fsdk-for-go\u002Fapi) [![Apache V2 License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache%20V2-blue.svg)](https:\u002F\u002Fgithub.com\u002Faws\u002Faws-sdk-go\u002Fblob\u002Fmain\u002FLICENSE.txt)\n\n# :no_entry_sign: This SDK has reached end-of-support\n\nWe previously [announced](https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fdeveloper\u002Fannouncing-end-of-support-for-aws-sdk-for-go-v1-on-july-31-2025)\nour end-of-support plan for AWS SDK for Go (v1).\n\nPer that announcement, as of 7\u002F31\u002F2025, **the SDK has entered end-of-support**.\nIt will not receive further updates.\n\nWe recommend that you migrate to [AWS SDK for Go v2](https:\u002F\u002Faws.github.io\u002Faws-sdk-go-v2\u002Fdocs\u002F).\nFor additional details as well as information on how to migrate, please refer\nto the linked announcement.\n\n## Quick Examples\n\n### Complete SDK Example\n\nThis example shows a complete working Go file which will upload a file to S3\nand use the Context pattern to implement timeout logic that will cancel the\nrequest if it takes too long. This example highlights how to use sessions,\ncreate a service client, make a request, handle the error, and process the\nresponse.\n\n```go\n  package main\n\n  import (\n  \t\"context\"\n  \t\"flag\"\n  \t\"fmt\"\n  \t\"os\"\n  \t\"time\"\n\n  \t\"github.com\u002Faws\u002Faws-sdk-go\u002Faws\"\n  \t\"github.com\u002Faws\u002Faws-sdk-go\u002Faws\u002Fawserr\"\n  \t\"github.com\u002Faws\u002Faws-sdk-go\u002Faws\u002Frequest\"\n  \t\"github.com\u002Faws\u002Faws-sdk-go\u002Faws\u002Fsession\"\n  \t\"github.com\u002Faws\u002Faws-sdk-go\u002Fservice\u002Fs3\"\n  )\n\n  \u002F\u002F Uploads a file to S3 given a bucket and object key. Also takes a duration\n  \u002F\u002F value to terminate the update if it doesn't complete within that time.\n  \u002F\u002F\n  \u002F\u002F The AWS Region needs to be provided in the AWS shared config or on the\n  \u002F\u002F environment variable as `AWS_REGION`. Credentials also must be provided\n  \u002F\u002F Will default to shared config file, but can load from environment if provided.\n  \u002F\u002F\n  \u002F\u002F Usage:\n  \u002F\u002F   # Upload myfile.txt to myBucket\u002FmyKey. Must complete within 10 minutes or will fail\n  \u002F\u002F   go run withContext.go -b mybucket -k myKey -d 10m \u003C myfile.txt\n  func main() {\n  \tvar bucket, key string\n  \tvar timeout time.Duration\n\n  \tflag.StringVar(&bucket, \"b\", \"\", \"Bucket name.\")\n  \tflag.StringVar(&key, \"k\", \"\", \"Object key name.\")\n  \tflag.DurationVar(&timeout, \"d\", 0, \"Upload timeout.\")\n  \tflag.Parse()\n\n  \t\u002F\u002F All clients require a Session. The Session provides the client with\n \t\u002F\u002F shared configuration such as region, endpoint, and credentials. A\n \t\u002F\u002F Session should be shared where possible to take advantage of\n \t\u002F\u002F configuration and credential caching. See the session package for\n \t\u002F\u002F more information.\n  \tsess := session.Must(session.NewSession())\n\n \t\u002F\u002F Create a new instance of the service's client with a Session.\n \t\u002F\u002F Optional aws.Config values can also be provided as variadic arguments\n \t\u002F\u002F to the New function. This option allows you to provide service\n \t\u002F\u002F specific configuration.\n  \tsvc := s3.New(sess)\n\n  \t\u002F\u002F Create a context with a timeout that will abort the upload if it takes\n  \t\u002F\u002F more than the passed in timeout.\n  \tctx := context.Background()\n  \tvar cancelFn func()\n  \tif timeout > 0 {\n  \t\tctx, cancelFn = context.WithTimeout(ctx, timeout)\n  \t}\n  \t\u002F\u002F Ensure the context is canceled to prevent leaking.\n  \t\u002F\u002F See context package for more information, https:\u002F\u002Fgolang.org\u002Fpkg\u002Fcontext\u002F\n\tif cancelFn != nil {\n  \t\tdefer cancelFn()\n\t}\n\n  \t\u002F\u002F Uploads the object to S3. The Context will interrupt the request if the\n  \t\u002F\u002F timeout expires.\n  \t_, err := svc.PutObjectWithContext(ctx, &s3.PutObjectInput{\n  \t\tBucket: aws.String(bucket),\n  \t\tKey:    aws.String(key),\n  \t\tBody:   os.Stdin,\n  \t})\n  \tif err != nil {\n  \t\tif aerr, ok := err.(awserr.Error); ok && aerr.Code() == request.CanceledErrorCode {\n  \t\t\t\u002F\u002F If the SDK can determine the request or retry delay was canceled\n  \t\t\t\u002F\u002F by a context the CanceledErrorCode error code will be returned.\n  \t\t\tfmt.Fprintf(os.Stderr, \"upload canceled due to timeout, %v\\n\", err)\n  \t\t} else {\n  \t\t\tfmt.Fprintf(os.Stderr, \"failed to upload object, %v\\n\", err)\n  \t\t}\n  \t\tos.Exit(1)\n  \t}\n\n  \tfmt.Printf(\"successfully uploaded file to %s\u002F%s\\n\", bucket, key)\n  }\n```\n\n### Overview of SDK's Packages\n\nThe SDK is composed of two main components, SDK core, and service clients.\nThe SDK core packages are all available under the aws package at the root of\nthe SDK. Each client for a supported AWS service is available within its own\npackage under the service folder at the root of the SDK.\n\n- aws - SDK core, provides common shared types such as Config, Logger,\n  and utilities to make working with API parameters easier.\n\n    - awserr - Provides the error interface that the SDK will use for all\n      errors that occur in the SDK's processing. This includes service API\n      response errors as well. The Error type is made up of a code and message.\n      Cast the SDK's returned error type to awserr.Error and call the Code\n      method to compare returned error to specific error codes. See the package's\n      documentation for additional values that can be extracted such as RequestID.\n\n    - credentials - Provides the types and built in credentials providers\n      the SDK will use to retrieve AWS credentials to make API requests with.\n      Nested under this folder are also additional credentials providers such as\n      stscreds for assuming IAM roles, and ec2rolecreds for EC2 Instance roles.\n\n    - endpoints - Provides the AWS Regions and Endpoints metadata for the SDK.\n      Use this to lookup AWS service endpoint information such as which services\n      are in a region, and what regions a service is in. Constants are also provided\n      for all region identifiers, e.g UsWest2RegionID for \"us-west-2\".\n\n    - session - Provides initial default configuration, and load\n      configuration from external sources such as environment and shared\n      credentials file.\n\n    - request - Provides the API request sending, and retry logic for the SDK.\n      This package also includes utilities for defining your own request\n      retryer, and configuring how the SDK processes the request.\n\n- service - Clients for AWS services. All services supported by the SDK are\n  available under this folder.\n\n### How to Use the SDK's AWS Service Clients\n\nThe SDK includes the Go types and utilities you can use to make requests to\nAWS service APIs. Within the service folder at the root of the SDK you'll find\na package for each AWS service the SDK supports. All service clients follow common pattern of creation and usage.\n\nWhen creating a client for an AWS service you'll first need to have a Session\nvalue constructed. The Session provides shared configuration that can be shared\nbetween your service clients. When service clients are created you can pass\nin additional configuration via the aws.Config type to override configuration\nprovided by in the Session to create service client instances with custom\nconfiguration.\n\nOnce the service's client is created you can use it to make API requests the\nAWS service. These clients are safe to use concurrently.\n\n### Configuring the SDK\n\nIn the AWS SDK for Go, you can configure settings for service clients, such\nas the log level and maximum number of retries. Most settings are optional;\nhowever, for each service client, you must specify a region and your credentials.\nThe SDK uses these values to send requests to the correct AWS region and sign\nrequests with the correct credentials. You can specify these values as part\nof a session or as environment variables.\n\nSee the SDK's [configuration guide][config_guide] for more information.\n\nSee the [session][session_pkg] package documentation for more information on how to use Session\nwith the SDK.\n\nSee the [Config][config_typ] type in the [aws][aws_pkg] package for more information on configuration\noptions.\n\n[config_guide]: https:\u002F\u002Fdocs.aws.amazon.com\u002Fsdk-for-go\u002Fv1\u002Fdeveloper-guide\u002Fconfiguring-sdk.html\n[session_pkg]: https:\u002F\u002Fdocs.aws.amazon.com\u002Fsdk-for-go\u002Fapi\u002Faws\u002Fsession\u002F\n[config_typ]: https:\u002F\u002Fdocs.aws.amazon.com\u002Fsdk-for-go\u002Fapi\u002Faws\u002F#Config\n[aws_pkg]: https:\u002F\u002Fdocs.aws.amazon.com\u002Fsdk-for-go\u002Fapi\u002Faws\u002F\n\n### Configuring Credentials\n\nWhen using the SDK you'll generally need your AWS credentials to authenticate\nwith AWS services. The SDK supports multiple methods of supporting these\ncredentials. By default the SDK will source credentials automatically from\nits default credential chain. See the session package for more information\non this chain, and how to configure it. The common items in the credential\nchain are the following:\n\n- Environment Credentials - Set of environment variables that are useful\n  when sub processes are created for specific roles.\n\n- Shared Credentials file (~\u002F.aws\u002Fcredentials) - This file stores your\n  credentials based on a profile name and is useful for local development.\n\n- EC2 Instance Role Credentials - Use EC2 Instance Role to assign credentials\n  to application running on an EC2 instance. This removes the need to manage\n  credential files in production.\n\nCredentials can be configured in code as well by setting the Config's Credentials\nvalue to a custom provider or using one of the providers included with the\nSDK to bypass the default credential chain and use a custom one. This is\nhelpful when you want to instruct the SDK to only use a specific set of\ncredentials or providers.\n\nThis example creates a credential provider for assuming an IAM role, \"myRoleARN\"\nand configures the S3 service client to use that role for API requests.\n\n```go\n  \u002F\u002F Initial credentials loaded from SDK's default credential chain. Such as\n  \u002F\u002F the environment, shared credentials (~\u002F.aws\u002Fcredentials), or EC2 Instance\n  \u002F\u002F Role. These credentials will be used to to make the STS Assume Role API.\n  sess := session.Must(session.NewSession())\n\n  \u002F\u002F Create the credentials from AssumeRoleProvider to assume the role\n  \u002F\u002F referenced by the \"myRoleARN\" ARN.\n  creds := stscreds.NewCredentials(sess, \"myRoleArn\")\n\n  \u002F\u002F Create service client value configured for credentials\n  \u002F\u002F from assumed role.\n  svc := s3.New(sess, &aws.Config{Credentials: creds})\n```\n\nSee the [credentials][credentials_pkg] package documentation for more information on credential\nproviders included with the SDK, and how to customize the SDK's usage of\ncredentials.\n\nThe SDK has support for the shared configuration file (~\u002F.aws\u002Fconfig). This\nsupport can be enabled by setting the environment variable, \"AWS_SDK_LOAD_CONFIG=1\",\nor enabling the feature in code when creating a Session via the\nOption's SharedConfigState parameter.\n\n```go\n  sess := session.Must(session.NewSessionWithOptions(session.Options{\n      SharedConfigState: session.SharedConfigEnable,\n  }))\n```\n\n[credentials_pkg]: https:\u002F\u002Fdocs.aws.amazon.com\u002Fsdk-for-go\u002Fapi\u002Faws\u002Fcredentials\n\n### Configuring AWS Region\n\nIn addition to the credentials you'll need to specify the region the SDK\nwill use to make AWS API requests to. In the SDK you can specify the region\neither with an environment variable, or directly in code when a Session or\nservice client is created. The last value specified in code wins if the region\nis specified multiple ways.\n\nTo set the region via the environment variable set the \"AWS_REGION\" to the\nregion you want to the SDK to use. Using this method to set the region will\nallow you to run your application in multiple regions without needing additional\ncode in the application to select the region.\n\n    AWS_REGION=us-west-2\n\nThe endpoints package includes constants for all regions the SDK knows. The\nvalues are all suffixed with RegionID. These values are helpful, because they\nreduce the need to type the region string manually.\n\nTo set the region on a Session use the aws package's Config struct parameter\nRegion to the AWS region you want the service clients created from the session to\nuse. This is helpful when you want to create multiple service clients, and\nall of the clients make API requests to the same region.\n\n```go\n  sess := session.Must(session.NewSession(&aws.Config{\n      Region: aws.String(endpoints.UsWest2RegionID),\n  }))\n```\n\nSee the [endpoints][endpoints_pkg] package for the AWS Regions and Endpoints metadata.\n\nIn addition to setting the region when creating a Session you can also set\nthe region on a per service client bases. This overrides the region of a\nSession. This is helpful when you want to create service clients in specific\nregions different from the Session's region.\n\n```go\n  svc := s3.New(sess, &aws.Config{\n      Region: aws.String(endpoints.UsWest2RegionID),\n  })\n```\n\nSee the [Config][config_typ] type in the [aws][aws_pkg] package for more information and additional\noptions such as setting the Endpoint, and other service client configuration options.\n\n[endpoints_pkg]: https:\u002F\u002Fdocs.aws.amazon.com\u002Fsdk-for-go\u002Fapi\u002Faws\u002Fendpoints\u002F\n\n### Making API Requests\n\nOnce the client is created you can make an API request to the service.\nEach API method takes a input parameter, and returns the service response\nand an error. The SDK provides methods for making the API call in multiple ways.\n\nIn this list we'll use the S3 ListObjects API as an example for the different\nways of making API requests.\n\n- ListObjects - Base API operation that will make the API request to the service.\n\n- ListObjectsRequest - API methods suffixed with Request will construct the\n  API request, but not send it. This is also helpful when you want to get a\n  presigned URL for a request, and share the presigned URL instead of your\n  application making the request directly.\n\n- ListObjectsPages - Same as the base API operation, but uses a callback to\n  automatically handle pagination of the API's response.\n\n- ListObjectsWithContext - Same as base API operation, but adds support for\n  the Context pattern. This is helpful for controlling the canceling of in\n  flight requests. See the Go standard library context package for more\n  information. This method also takes request package's Option functional\n  options as the variadic argument for modifying how the request will be\n  made, or extracting information from the raw HTTP response.\n\n- ListObjectsPagesWithContext - same as ListObjectsPages, but adds support for\n  the Context pattern. Similar to ListObjectsWithContext this method also\n  takes the request package's Option function option types as the variadic\n  argument.\n\nIn addition to the API operations the SDK also includes several higher level\nmethods that abstract checking for and waiting for an AWS resource to be in\na desired state. In this list we'll use WaitUntilBucketExists to demonstrate\nthe different forms of waiters.\n\n- WaitUntilBucketExists. - Method to make API request to query an AWS service for\n  a resource's state. Will return successfully when that state is accomplished.\n\n- WaitUntilBucketExistsWithContext - Same as WaitUntilBucketExists, but adds\n  support for the Context pattern. In addition these methods take request\n  package's WaiterOptions to configure the waiter, and how underlying request\n  will be made by the SDK.\n\nThe API method will document which error codes the service might return for\nthe operation. These errors will also be available as const strings prefixed\nwith \"ErrCode\" in the service client's package. If there are no errors listed\nin the API's SDK documentation you'll need to consult the AWS service's API\ndocumentation for the errors that could be returned.\n\n```go\n  ctx := context.Background()\n\n  result, err := svc.GetObjectWithContext(ctx, &s3.GetObjectInput{\n      Bucket: aws.String(\"my-bucket\"),\n      Key: aws.String(\"my-key\"),\n  })\n  if err != nil {\n      \u002F\u002F Cast err to awserr.Error to handle specific error codes.\n      aerr, ok := err.(awserr.Error)\n      if ok && aerr.Code() == s3.ErrCodeNoSuchKey {\n          \u002F\u002F Specific error code handling\n      }\n      return err\n  }\n\n  \u002F\u002F Make sure to close the body when done with it for S3 GetObject APIs or\n  \u002F\u002F will leak connections.\n  defer result.Body.Close()\n\n  fmt.Println(\"Object Size:\", aws.Int64Value(result.ContentLength))\n```\n\n### API Request Pagination and Resource Waiters\n\nPagination helper methods are suffixed with \"Pages\", and provide the\nfunctionality needed to round trip API page requests. Pagination methods\ntake a callback function that will be called for each page of the API's response.\n\n```go\n   objects := []string{}\n   err := svc.ListObjectsPagesWithContext(ctx, &s3.ListObjectsInput{\n       Bucket: aws.String(myBucket),\n   }, func(p *s3.ListObjectsOutput, lastPage bool) bool {\n       for _, o := range p.Contents {\n           objects = append(objects, aws.StringValue(o.Key))\n       }\n       return true \u002F\u002F continue paging\n   })\n   if err != nil {\n       panic(fmt.Sprintf(\"failed to list objects for bucket, %s, %v\", myBucket, err))\n   }\n\n   fmt.Println(\"Objects in bucket:\", objects)\n```\n\nWaiter helper methods provide the functionality to wait for an AWS resource\nstate. These methods abstract the logic needed to check the state of an\nAWS resource, and wait until that resource is in a desired state. The waiter\nwill block until the resource is in the state that is desired, an error occurs,\nor the waiter times out. If a resource times out the error code returned will\nbe request.WaiterResourceNotReadyErrorCode.\n\n```go\n  err := svc.WaitUntilBucketExistsWithContext(ctx, &s3.HeadBucketInput{\n      Bucket: aws.String(myBucket),\n  })\n  if err != nil {\n      aerr, ok := err.(awserr.Error)\n      if ok && aerr.Code() == request.WaiterResourceNotReadyErrorCode {\n          fmt.Fprintf(os.Stderr, \"timed out while waiting for bucket to exist\")\n      }\n      panic(fmt.Errorf(\"failed to wait for bucket to exist, %v\", err))\n  }\n  fmt.Println(\"Bucket\", myBucket, \"exists\")\n```\n\n## Resources\n\n[Developer guide](https:\u002F\u002Fdocs.aws.amazon.com\u002Fsdk-for-go\u002Fv1\u002Fdeveloper-guide\u002Fwelcome.html) - This document\nis a general introduction on how to configure and make requests with the SDK.\nIf this is your first time using the SDK, this documentation and the API\ndocumentation will help you get started. This document focuses on the syntax\nand behavior of the SDK. The [Service Developer Guide](https:\u002F\u002Faws.amazon.com\u002Fdocumentation\u002F)\nwill help you get started using specific AWS services.\n\n[SDK API Reference Documentation](https:\u002F\u002Fdocs.aws.amazon.com\u002Fsdk-for-go\u002Fapi\u002F) - Use this\ndocument to look up all API operation input and output parameters for AWS\nservices supported by the SDK. The API reference also includes documentation of\nthe SDK, and examples how to using the SDK, service client API operations, and\nAPI operation require parameters.\n\n[Service Documentation](https:\u002F\u002Faws.amazon.com\u002Fdocumentation\u002F) - Use this\ndocumentation to learn how to interface with AWS services. These guides are\ngreat for getting started with a service, or when looking for more\ninformation about a service. While this document is not required for coding,\nservices may supply helpful samples to look out for.\n\n[SDK Examples](https:\u002F\u002Fgithub.com\u002Faws\u002Faws-sdk-go\u002Ftree\u002Fmain\u002Fexample) -\nIncluded in the SDK's repo are several hand crafted examples using the SDK\nfeatures and AWS services.\n","aws\u002Faws-sdk-go 是一个用于与 AWS 服务交互的 Go 语言 SDK，现已进入维护终止阶段。该项目提供了丰富的 API 接口，支持通过 Go 语言访问包括 S3、DynamoDB 在内的多种 AWS 服务。其核心功能包括使用上下文模式实现请求超时控制、配置会话共享以及创建和管理服务客户端等。尽管如此，由于官方已宣布自 2025 年 7 月 31 日起停止对该版本的支持，并推荐用户迁移到 v2 版本，因此对于新项目或现有项目的长期维护来说，建议直接采用 aws\u002Faws-sdk-go-v2。该 SDK 曾经非常适合需要在 Go 应用程序中集成 AWS 服务的开发者使用。",2,"2026-06-11 03:02:42","top_language"]