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