context_1_5.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // +build !go1.9
  2. package aws
  3. import "time"
  4. // Context is an copy of the Go v1.7 stdlib's context.Context interface.
  5. // It is represented as a SDK interface to enable you to use the "WithContext"
  6. // API methods with Go v1.6 and a Context type such as golang.org/x/net/context.
  7. //
  8. // See https://golang.org/pkg/context on how to use contexts.
  9. type Context interface {
  10. // Deadline returns the time when work done on behalf of this context
  11. // should be canceled. Deadline returns ok==false when no deadline is
  12. // set. Successive calls to Deadline return the same results.
  13. Deadline() (deadline time.Time, ok bool)
  14. // Done returns a channel that's closed when work done on behalf of this
  15. // context should be canceled. Done may return nil if this context can
  16. // never be canceled. Successive calls to Done return the same value.
  17. Done() <-chan struct{}
  18. // Err returns a non-nil error value after Done is closed. Err returns
  19. // Canceled if the context was canceled or DeadlineExceeded if the
  20. // context's deadline passed. No other values for Err are defined.
  21. // After Done is closed, successive calls to Err return the same value.
  22. Err() error
  23. // Value returns the value associated with this context for key, or nil
  24. // if no value is associated with key. Successive calls to Value with
  25. // the same key returns the same result.
  26. //
  27. // Use context values only for request-scoped data that transits
  28. // processes and API boundaries, not for passing optional parameters to
  29. // functions.
  30. Value(key interface{}) interface{}
  31. }