mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Output from 'dep status': PROJECT CONSTRAINT VERSION REVISION LATEST PKGS USED cloud.google.com/go v0.23.0 v0.23.0 0fd7230 v0.23.0 1 github.com/briandowns/openweathermap ^0.11.0 0.11 1b87579 0.11 1 github.com/gdamore/encoding branch master branch master b23993c b23993c 1 github.com/gdamore/tcell ^1.0.0 v1.0.0 061d51a v1.0.0 2 github.com/go-test/deep ^1.0.1 v1.0.1 6592d9c v1.0.1 1 github.com/golang/protobuf v1.1.0 v1.1.0 b4deda0 v1.1.0 1 github.com/google/go-github branch master branch master 2ae5df7 2ae5df7 1 github.com/google/go-querystring branch master branch master 53e6ce1 53e6ce1 1 github.com/jessevdk/go-flags ^1.4.0 v1.4.0 c6ca198 v1.4.0 1 github.com/lucasb-eyer/go-colorful v1.0 v1.0 345fbb3 v1.0 1 github.com/mattn/go-runewidth v0.0.2 v0.0.2 9e777a8 v0.0.2 1 github.com/olebedev/config branch master branch master 9a10d05 9a10d05 1 github.com/radovskyb/watcher ^1.0.2 v1.0.2 6145e14 v1.0.2 1 github.com/rivo/tview branch master branch master 71ecf1f 71ecf1f 1 github.com/yfronto/newrelic branch master branch master f7fa0c6 f7fa0c6 1 golang.org/x/net branch master branch master 1e49130 1e49130 2 golang.org/x/oauth2 branch master branch master 1e0a3fa 1e0a3fa 5 golang.org/x/text v0.3.0 v0.3.0 f21a4df v0.3.0 5 google.golang.org/api branch master branch master 00e3bb8 00e3bb8 4 google.golang.org/appengine v1.0.0 v1.0.0 150dc57 v1.0.0 10 gopkg.in/yaml.v2 ^2.2.1 v2.2.1 5420a8b v2.2.1 1 See https://golang.github.io/dep/docs/daily-dep.html
110 lines
4.0 KiB
Go
110 lines
4.0 KiB
Go
// Copyright 2014 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// +build !go1.9
|
|
|
|
package context
|
|
|
|
import "time"
|
|
|
|
// A Context carries a deadline, a cancelation signal, and other values across
|
|
// API boundaries.
|
|
//
|
|
// Context's methods may be called by multiple goroutines simultaneously.
|
|
type Context interface {
|
|
// Deadline returns the time when work done on behalf of this context
|
|
// should be canceled. Deadline returns ok==false when no deadline is
|
|
// set. Successive calls to Deadline return the same results.
|
|
Deadline() (deadline time.Time, ok bool)
|
|
|
|
// Done returns a channel that's closed when work done on behalf of this
|
|
// context should be canceled. Done may return nil if this context can
|
|
// never be canceled. Successive calls to Done return the same value.
|
|
//
|
|
// WithCancel arranges for Done to be closed when cancel is called;
|
|
// WithDeadline arranges for Done to be closed when the deadline
|
|
// expires; WithTimeout arranges for Done to be closed when the timeout
|
|
// elapses.
|
|
//
|
|
// Done is provided for use in select statements:
|
|
//
|
|
// // Stream generates values with DoSomething and sends them to out
|
|
// // until DoSomething returns an error or ctx.Done is closed.
|
|
// func Stream(ctx context.Context, out chan<- Value) error {
|
|
// for {
|
|
// v, err := DoSomething(ctx)
|
|
// if err != nil {
|
|
// return err
|
|
// }
|
|
// select {
|
|
// case <-ctx.Done():
|
|
// return ctx.Err()
|
|
// case out <- v:
|
|
// }
|
|
// }
|
|
// }
|
|
//
|
|
// See http://blog.golang.org/pipelines for more examples of how to use
|
|
// a Done channel for cancelation.
|
|
Done() <-chan struct{}
|
|
|
|
// Err returns a non-nil error value after Done is closed. Err returns
|
|
// Canceled if the context was canceled or DeadlineExceeded if the
|
|
// context's deadline passed. No other values for Err are defined.
|
|
// After Done is closed, successive calls to Err return the same value.
|
|
Err() error
|
|
|
|
// Value returns the value associated with this context for key, or nil
|
|
// if no value is associated with key. Successive calls to Value with
|
|
// the same key returns the same result.
|
|
//
|
|
// Use context values only for request-scoped data that transits
|
|
// processes and API boundaries, not for passing optional parameters to
|
|
// functions.
|
|
//
|
|
// A key identifies a specific value in a Context. Functions that wish
|
|
// to store values in Context typically allocate a key in a global
|
|
// variable then use that key as the argument to context.WithValue and
|
|
// Context.Value. A key can be any type that supports equality;
|
|
// packages should define keys as an unexported type to avoid
|
|
// collisions.
|
|
//
|
|
// Packages that define a Context key should provide type-safe accessors
|
|
// for the values stores using that key:
|
|
//
|
|
// // Package user defines a User type that's stored in Contexts.
|
|
// package user
|
|
//
|
|
// import "golang.org/x/net/context"
|
|
//
|
|
// // User is the type of value stored in the Contexts.
|
|
// type User struct {...}
|
|
//
|
|
// // key is an unexported type for keys defined in this package.
|
|
// // This prevents collisions with keys defined in other packages.
|
|
// type key int
|
|
//
|
|
// // userKey is the key for user.User values in Contexts. It is
|
|
// // unexported; clients use user.NewContext and user.FromContext
|
|
// // instead of using this key directly.
|
|
// var userKey key = 0
|
|
//
|
|
// // NewContext returns a new Context that carries value u.
|
|
// func NewContext(ctx context.Context, u *User) context.Context {
|
|
// return context.WithValue(ctx, userKey, u)
|
|
// }
|
|
//
|
|
// // FromContext returns the User value stored in ctx, if any.
|
|
// func FromContext(ctx context.Context) (*User, bool) {
|
|
// u, ok := ctx.Value(userKey).(*User)
|
|
// return u, ok
|
|
// }
|
|
Value(key interface{}) interface{}
|
|
}
|
|
|
|
// A CancelFunc tells an operation to abandon its work.
|
|
// A CancelFunc does not wait for the work to stop.
|
|
// After the first call, subsequent calls to a CancelFunc do nothing.
|
|
type CancelFunc func()
|