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