massive refactoring for interoperability

This commit is contained in:
Darien Raymond committed 2018-01-10 12:22:37 +01:00
1 parent 5a3c7fdd20
commit 292d7cc353
66 files changed
+1515 -1200

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
package core
import (
"context"
)
type key int
const v2rayKey key = 1
// FromContext returns a Instance from the given context, or nil if the context doesn't contain one.
func FromContext(ctx context.Context) *Instance {
if s, ok := ctx.Value(v2rayKey).(*Instance); ok {
return s
}
return nil
}