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