Package list golang-github-go-kit-kit / 5b6e97d
add periods to function comments. Victor Vrantchan 4 years ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
1717 )
1818
1919 // ToHTTPContext moves JWT token from request header to context. Particularly
20 // useful for servers
20 // useful for servers.
2121 func ToHTTPContext() http.RequestFunc {
2222 return func(ctx context.Context, r *stdhttp.Request) context.Context {
2323 token, ok := extractTokenFromAuthHeader(r.Header.Get("Authorization"))
3030 }
3131
3232 // FromHTTPContext moves JWT token from context to request header. Particularly
33 // useful for clients
33 // useful for clients.
3434 func FromHTTPContext() http.RequestFunc {
3535 return func(ctx context.Context, r *stdhttp.Request) context.Context {
3636 token, ok := ctx.Value(JWTTokenContextKey).(string)
4242 }
4343
4444 // ToGRPCContext moves JWT token from grpc metadata to context. Particularly
45 // userful for servers
45 // userful for servers.
4646 func ToGRPCContext() grpc.RequestFunc {
4747 return func(ctx context.Context, md *metadata.MD) context.Context {
4848 // capital "Key" is illegal in HTTP/2.
6161 }
6262
6363 // FromGRPCContext moves JWT token from context to grpc metadata. Particularly
64 // useful for clients
64 // useful for clients.
6565 func FromGRPCContext() grpc.RequestFunc {
6666 return func(ctx context.Context, md *metadata.MD) context.Context {
6767 token, ok := ctx.Value(JWTTokenContextKey).(string)