doc.go 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Package aws provides the core SDK's utilities and shared types. Use this package's
  2. // utilities to simplify setting and reading API operations parameters.
  3. //
  4. // # Value and Pointer Conversion Utilities
  5. //
  6. // This package includes a helper conversion utility for each scalar type the SDK's
  7. // API use. These utilities make getting a pointer of the scalar, and dereferencing
  8. // a pointer easier.
  9. //
  10. // Each conversion utility comes in two forms. Value to Pointer and Pointer to Value.
  11. // The Pointer to value will safely dereference the pointer and return its value.
  12. // If the pointer was nil, the scalar's zero value will be returned.
  13. //
  14. // The value to pointer functions will be named after the scalar type. So get a
  15. // *string from a string value use the "String" function. This makes it easy to
  16. // to get pointer of a literal string value, because getting the address of a
  17. // literal requires assigning the value to a variable first.
  18. //
  19. // var strPtr *string
  20. //
  21. // // Without the SDK's conversion functions
  22. // str := "my string"
  23. // strPtr = &str
  24. //
  25. // // With the SDK's conversion functions
  26. // strPtr = aws.String("my string")
  27. //
  28. // // Convert *string to string value
  29. // str = aws.ToString(strPtr)
  30. //
  31. // In addition to scalars the aws package also includes conversion utilities for
  32. // map and slice for commonly types used in API parameters. The map and slice
  33. // conversion functions use similar naming pattern as the scalar conversion
  34. // functions.
  35. //
  36. // var strPtrs []*string
  37. // var strs []string = []string{"Go", "Gophers", "Go"}
  38. //
  39. // // Convert []string to []*string
  40. // strPtrs = aws.StringSlice(strs)
  41. //
  42. // // Convert []*string to []string
  43. // strs = aws.ToStringSlice(strPtrs)
  44. //
  45. // # SDK Default HTTP Client
  46. //
  47. // The SDK will use the http.DefaultClient if a HTTP client is not provided to
  48. // the SDK's Session, or service client constructor. This means that if the
  49. // http.DefaultClient is modified by other components of your application the
  50. // modifications will be picked up by the SDK as well.
  51. //
  52. // In some cases this might be intended, but it is a better practice to create
  53. // a custom HTTP Client to share explicitly through your application. You can
  54. // configure the SDK to use the custom HTTP Client by setting the HTTPClient
  55. // value of the SDK's Config type when creating a Session or service client.
  56. package aws
  57. // generate.go uses a build tag of "ignore", go run doesn't need to specify
  58. // this because go run ignores all build flags when running a go file directly.
  59. //go:generate go run -tags codegen generate.go
  60. //go:generate go run -tags codegen logging_generate.go
  61. //go:generate gofmt -w -s .