Documentation
¶
Index ¶
- Variables
- func ClearMetadataAccessToken(md metadata.MD) metadata.MD
- func ClearMetadataAuthorizationToken(md metadata.MD) metadata.MD
- func ClearMetadataGCloudAuthorizationToken(md metadata.MD) metadata.MD
- func ClearMetadataRefreshToken(md metadata.MD) metadata.MD
- func DeleteMetadataValue(md metadata.MD, key string) metadata.MD
- func GetIncomingCtxMetadata(ctx context.Context) (metadata.MD, error)
- func GetIncomingCtxMetadataAccessToken(ctx context.Context) (string, error)
- func GetIncomingCtxMetadataAuthorizationToken(ctx context.Context) (string, error)
- func GetIncomingCtxMetadataBearerToken(ctx context.Context, key string) (string, error)
- func GetIncomingCtxMetadataGCloudAuthorizationToken(ctx context.Context) (string, error)
- func GetIncomingCtxMetadataRefreshToken(ctx context.Context) (string, error)
- func GetIncomingCtxMetadataValue(ctx context.Context, key string) ([]string, error)
- func GetMetadataAccessToken(md metadata.MD) (string, error)
- func GetMetadataAuthorizationToken(md metadata.MD) (string, error)
- func GetMetadataBearerToken(md metadata.MD, key string) (string, error)
- func GetMetadataGCloudAuthorizationToken(md metadata.MD) (string, error)
- func GetMetadataRefreshToken(md metadata.MD) (string, error)
- func GetMetadataValue(md metadata.MD, key string) ([]string, error)
- func GetOutgoingCtxMetadata(ctx context.Context) metadata.MD
- func GetOutgoingCtxMetadataAccessToken(ctx context.Context) (string, error)
- func GetOutgoingCtxMetadataAuthorizationToken(ctx context.Context) (string, error)
- func GetOutgoingCtxMetadataGCloudAuthorizationToken(ctx context.Context) (string, error)
- func GetOutgoingCtxMetadataRefreshToken(ctx context.Context) (string, error)
- func SetMetadataAccessToken(md metadata.MD, accessToken string) metadata.MD
- func SetMetadataAuthorizationToken(md metadata.MD, token string) metadata.MD
- func SetMetadataBearerToken(md metadata.MD, key, token string) metadata.MD
- func SetMetadataGCloudAuthorizationToken(md metadata.MD, token string) metadata.MD
- func SetMetadataRefreshToken(md metadata.MD, refreshToken string) metadata.MD
- func SetOutgoingCtxMetadataAccessToken(ctx context.Context, accessToken string) (context.Context, error)
- func SetOutgoingCtxMetadataAuthorizationToken(ctx context.Context, token string) (context.Context, error)
- func SetOutgoingCtxMetadataBearerToken(ctx context.Context, key, token string) (context.Context, error)
- func SetOutgoingCtxMetadataGCloudAuthorizationToken(ctx context.Context, token string) (context.Context, error)
- func SetOutgoingCtxMetadataRefreshToken(ctx context.Context, refreshToken string) (context.Context, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrNilMetadata = errors.New("missing metadata") ErrNilMetadataKeyValue = errors.New("metadata key value is nil") ErrAuthorizationMetadataInvalid = errors.New("authorization metadata invalid") ErrAuthorizationMetadataNotProvided = errors.New("authorization metadata is not provided") )
Functions ¶
func ClearMetadataAccessToken ¶
ClearMetadataAccessToken clears the access token from the metadata
Parameters:
- md: The metadata to clear the token from
Returns:
- metadata.MD: The metadata with the token cleared
func ClearMetadataAuthorizationToken ¶
ClearMetadataAuthorizationToken clears the authorization token from the metadata
Parameters:
- md: The metadata to clear the token from
Returns:
- metadata.MD: The metadata with the token cleared
func ClearMetadataGCloudAuthorizationToken ¶
ClearMetadataGCloudAuthorizationToken clears the GCloud authorization token from the metadata
Parameters:
- md: The metadata to clear the token from
Returns:
- metadata.MD: The metadata with the token cleared
func ClearMetadataRefreshToken ¶
ClearMetadataRefreshToken clears the refresh token from the metadata
Parameters:
- md: The metadata to clear the token from
Returns:
- metadata.MD: The metadata with the token cleared
func DeleteMetadataValue ¶
DeleteMetadataValue deletes the value for a given key from the metadata
Parameters:
- md: The metadata to delete the value from
- key: The key to delete the value for
Returns:
- metadata.MD: The metadata with the value deleted
func GetIncomingCtxMetadata ¶ added in v0.6.0
GetIncomingCtxMetadata gets the incoming metadata from the context
Parameters:
- ctx: The context to get the incoming metadata from
Returns:
- metadata.MD: The incoming metadata from the context
- error: An error if the metadata is not found or any other error occurs
func GetIncomingCtxMetadataAccessToken ¶ added in v0.6.0
GetIncomingCtxMetadataAccessToken gets the access token from the incoming context metadata
Parameters:
- ctx: The incoming context to get the token from
Returns:
- string: The token
- error: An error if the token is not found or any other error occurs
func GetIncomingCtxMetadataAuthorizationToken ¶ added in v0.6.0
GetIncomingCtxMetadataAuthorizationToken gets the authorization token from the incoming context metadata
Parameters:
- ctx: The incoming context to get the metadata from
Returns:
- string: The token
- error: An error if the token is not found or any other error occurs
func GetIncomingCtxMetadataBearerToken ¶ added in v0.6.0
GetIncomingCtxMetadataBearerToken gets the bearer token from the incoming context metadata
Parameters:
- ctx: The incoming context to get the metadata from
- key: The key to get the token for
Returns:
- string: The token
- error: An error if the token is not found or any other error occurs
func GetIncomingCtxMetadataGCloudAuthorizationToken ¶ added in v0.6.0
GetIncomingCtxMetadataGCloudAuthorizationToken gets the GCloud authorization token from the incoming context metadata
Parameters:
- ctx: The incoming context to get the metadata from
Returns:
- string: The token
- error: An error if the token is not found or any other error occurs
func GetIncomingCtxMetadataRefreshToken ¶ added in v0.6.0
GetIncomingCtxMetadataRefreshToken gets the refresh token from the incoming context metadata
Parameters:
- ctx: The incoming context to get the token from
Returns:
- string: The token
- error: An error if the token is not found or any other error occurs
func GetIncomingCtxMetadataValue ¶ added in v0.6.0
GetIncomingCtxMetadataValue gets the value for a given key from the context metadata
Parameters:
- ctx: The context to get the metadata from
- key: The key to get the value for
Returns:
- []string: The value for the given key
- error: An error if the key is not found or any other error occurs
func GetMetadataAccessToken ¶
GetMetadataAccessToken gets the access token from the metadata
Parameters:
- md: The metadata to get the token from
Returns:
- string: The token
- error: An error if the token is not found or any other error occurs
func GetMetadataAuthorizationToken ¶
GetMetadataAuthorizationToken gets the authorization token from the metadata
Parameters:
- md: The metadata to get the token from
Returns:
- string: The token
- error: An error if the token is not found or any other error occurs
func GetMetadataBearerToken ¶
GetMetadataBearerToken gets the bearer token from the metadata
Parameters:
- md: The metadata to get the token from
- key: The key to get the token for
Returns:
- string: The token
- error: An error if the token is not found or any other error occurs
func GetMetadataGCloudAuthorizationToken ¶
GetMetadataGCloudAuthorizationToken gets the GCloud authorization token from the metadata
Parameters:
- md: The metadata to get the token from
Returns:
- string: The token
- error: An error if the token is not found or any other error occurs
func GetMetadataRefreshToken ¶
GetMetadataRefreshToken gets the refresh token from the metadata
Parameters:
- md: The metadata to get the token from
Returns:
- string: The token
- error: An error if the token is not found or any other error occurs
func GetMetadataValue ¶
GetMetadataValue gets the value for a given key from the metadata
Parameters:
- md: The metadata to get the value from
- key: The key to get the value for
Returns:
- []string: The value for the given key
- error: An error if the key is not found or any other error occurs
func GetOutgoingCtxMetadata ¶ added in v0.6.0
GetOutgoingCtxMetadata gets the outgoing metadata from the context
Parameters:
- ctx: The context to get the outgoing metadata from
Returns:
- metadata.MD: The outgoing metadata from the context
func GetOutgoingCtxMetadataAccessToken ¶ added in v0.6.0
GetOutgoingCtxMetadataAccessToken gets the access token from the outgoing context metadata
Parameters:
- ctx: The outgoing context to get the token from
Returns:
- string: The token - error: An error if the token is not found or any other error occurs
func GetOutgoingCtxMetadataAuthorizationToken ¶ added in v0.6.0
GetOutgoingCtxMetadataAuthorizationToken gets the authorization token from the outgoing context metadata
Parameters:
- ctx: The outgoing context to get the token from
Returns:
- string: The token - error: An error if the token is not found or any other error occurs
func GetOutgoingCtxMetadataGCloudAuthorizationToken ¶ added in v0.6.0
GetOutgoingCtxMetadataGCloudAuthorizationToken gets the GCloud authorization token from the outgoing context metadata
Parameters:
- ctx: The outgoing context to get the token from
Returns:
- string: The token - error: An error if the token is not found or any other error occurs
func GetOutgoingCtxMetadataRefreshToken ¶ added in v0.6.0
GetOutgoingCtxMetadataRefreshToken gets the refresh token from the outgoing context metadata
Parameters:
- ctx: The outgoing context to get the token from
Returns:
- string: The token - error: An error if the token is not found or any other error occurs
func SetMetadataAccessToken ¶
SetMetadataAccessToken sets the access token to the metadata
Parameters:
- md: The metadata to set the token to
- accessToken: The token to set
Returns:
- metadata.MD: The metadata with the token set
func SetMetadataAuthorizationToken ¶
SetMetadataAuthorizationToken sets the authorization token to the metadata
Parameters:
- md: The metadata to set the token to
- token: The token to set
Returns:
- metadata.MD: The metadata with the token set
func SetMetadataBearerToken ¶
SetMetadataBearerToken sets the authorization token to the metadata
Parameters:
- md: The metadata to set the token to
- key: The metadata key where the token will be set
- token: The token to set
Returns:
- metadata.MD: The metadata with the token set
func SetMetadataGCloudAuthorizationToken ¶
SetMetadataGCloudAuthorizationToken sets the GCloud authorization token to the metadata
Parameters:
- md: The metadata to set the token to
- token: The token to set
Returns:
- metadata.MD: The metadata with the token set
func SetMetadataRefreshToken ¶
SetMetadataRefreshToken sets the refresh token to the metadata
Parameters:
- md: The metadata to set the token to
- refreshToken: The token to set
Returns:
- metadata.MD: The metadata with the token set
func SetOutgoingCtxMetadataAccessToken ¶ added in v0.6.0
func SetOutgoingCtxMetadataAccessToken( ctx context.Context, accessToken string, ) (context.Context, error)
SetOutgoingCtxMetadataAccessToken sets the access token to the metadata
Parameters:
- ctx: The outgoing context to set the token to
- accessToken: The token to set
Returns:
- context.Context: The context with the token set
- error: An error if the metadata is not found or any other error occurs
func SetOutgoingCtxMetadataAuthorizationToken ¶ added in v0.6.0
func SetOutgoingCtxMetadataAuthorizationToken( ctx context.Context, token string, ) (context.Context, error)
SetOutgoingCtxMetadataAuthorizationToken sets the authorization token to the metadata
Parameters:
- ctx: The outgoing context to set the token to
- token: The token to set
Returns:
- context.Context: The context with the token set
func SetOutgoingCtxMetadataBearerToken ¶ added in v0.6.0
func SetOutgoingCtxMetadataBearerToken( ctx context.Context, key, token string, ) (context.Context, error)
SetOutgoingCtxMetadataBearerToken sets the authorization token to the metadata
Parameters:
- ctx: The outgoing context to set the token to
- key: The metadata key where the token will be set
- token: The token to set
Returns:
- context.Context: The context with the token set
- error: An error if the metadata is not found or any other error occurs
func SetOutgoingCtxMetadataGCloudAuthorizationToken ¶ added in v0.6.0
func SetOutgoingCtxMetadataGCloudAuthorizationToken( ctx context.Context, token string, ) (context.Context, error)
SetOutgoingCtxMetadataGCloudAuthorizationToken sets the GCloud authorization token to the metadata
Parameters:
- ctx: The outgoing context to set the token to
- token: The token to set
Returns:
- context.Context: The context with the token set
- error: An error if the metadata is not found or any other error occurs
func SetOutgoingCtxMetadataRefreshToken ¶ added in v0.6.0
func SetOutgoingCtxMetadataRefreshToken( ctx context.Context, refreshToken string, ) (context.Context, error)
SetOutgoingCtxMetadataRefreshToken sets the refresh token to the metadata
Parameters:
- ctx: The outgoing context to set the token to
- refreshToken: The token to set
Returns:
- context.Context: The context with the token set
- error: An error if the metadata is not found or any other error occurs
Types ¶
This section is empty.