diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-11-29 01:46:27 +0100 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-11-29 18:14:16 +0100 |
commit | 18f52af5be3a9a0c73811706108f790d65ee9c67 (patch) | |
tree | e13cbacb47d56919caa9c44a2b45dec1497a7860 /vendor/github.com/pion/ice/v2/context.go | |
parent | ebcef0d57b6ecb5a40c6579f6be07182dd3033ba (diff) |
[pkg] update vendor
Diffstat (limited to 'vendor/github.com/pion/ice/v2/context.go')
-rw-r--r-- | vendor/github.com/pion/ice/v2/context.go | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/vendor/github.com/pion/ice/v2/context.go b/vendor/github.com/pion/ice/v2/context.go new file mode 100644 index 0000000..627d81e --- /dev/null +++ b/vendor/github.com/pion/ice/v2/context.go @@ -0,0 +1,37 @@ +package ice + +import ( + "context" + "time" +) + +func (a *Agent) context() context.Context { + return agentContext(a.done) +} + +type agentContext chan struct{} + +// Done implements context.Context +func (a agentContext) Done() <-chan struct{} { + return (chan struct{})(a) +} + +// Err implements context.Context +func (a agentContext) Err() error { + select { + case <-(chan struct{})(a): + return ErrRunCanceled + default: + return nil + } +} + +// Deadline implements context.Context +func (a agentContext) Deadline() (deadline time.Time, ok bool) { + return time.Time{}, false +} + +// Value implements context.Context +func (a agentContext) Value(key interface{}) interface{} { + return nil +} |