metadata

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicFromContext

func BasicFromContext(ctx context.Context) (username string, password string, err error)

BasicFromContext get username and password for basic authorization from context that contains metadata. Username will become lower case.

func BearerFromContext

func BearerFromContext(ctx context.Context) (token string, err error)

BearerFromContext get bearer token from context that contains metadata.

func TransferAuthorizationToGRPC

func TransferAuthorizationToGRPC(ctx context.Context) context.Context

TransferAuthorizationToGRPC will try to get authorization from metadata and transfer into grpc outgoing metadata. Do nothing if there is no authorization found in context.

func TransferAuthorizationToNewGRPC added in v0.1.2

func TransferAuthorizationToNewGRPC(ctx context.Context) context.Context

TransferAuthorizationToNewGRPC will try to get authorization from metadata and transfer into new grpc outgoing metadata. Do nothing if there is no authorization found in context.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL