remove context from client/server

This commit is contained in:
Asim Aslam 2020-08-23 14:11:57 +01:00
parent f55701b374
commit f698feac9c
2 changed files with 0 additions and 32 deletions

View File

@ -1,16 +0,0 @@
package client
import (
"context"
)
type clientKey struct{}
func FromContext(ctx context.Context) (Client, bool) {
c, ok := ctx.Value(clientKey{}).(Client)
return c, ok
}
func NewContext(ctx context.Context, c Client) context.Context {
return context.WithValue(ctx, clientKey{}, c)
}

View File

@ -1,16 +0,0 @@
package server
import (
"context"
)
type serverKey struct{}
func FromContext(ctx context.Context) (Server, bool) {
c, ok := ctx.Value(serverKey{}).(Server)
return c, ok
}
func NewContext(ctx context.Context, s Server) context.Context {
return context.WithValue(ctx, serverKey{}, s)
}