option.go 611 B

12345678910111213141516171819202122232425
  1. package auth
  2. import "github.com/aws/smithy-go"
  3. type (
  4. authOptionsKey struct{}
  5. )
  6. // Option represents a possible authentication method for an operation.
  7. type Option struct {
  8. SchemeID string
  9. IdentityProperties smithy.Properties
  10. SignerProperties smithy.Properties
  11. }
  12. // GetAuthOptions gets auth Options from Properties.
  13. func GetAuthOptions(p *smithy.Properties) ([]*Option, bool) {
  14. v, ok := p.Get(authOptionsKey{}).([]*Option)
  15. return v, ok
  16. }
  17. // SetAuthOptions sets auth Options on Properties.
  18. func SetAuthOptions(p *smithy.Properties, options []*Option) {
  19. p.Set(authOptionsKey{}, options)
  20. }