Documentation
¶
Index ¶
- Variables
- func ClearCtxMetadataAccessToken(ctx context.Context) (context.Context, error)
- func ClearCtxMetadataAuthorizationToken(ctx context.Context) (context.Context, error)
- func ClearCtxMetadataGCloudAuthorizationToken(ctx context.Context) (context.Context, error)
- func ClearCtxMetadataRefreshToken(ctx context.Context) (context.Context, error)
- 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 DeleteCtxMetadataValue(ctx context.Context, key string) (context.Context, error)
- func DeleteMetadataValue(md metadata.MD, key string) metadata.MD
- func GetCtxMetadata(ctx context.Context) (metadata.MD, error)
- func GetCtxMetadataAccessToken(ctx context.Context) (string, error)
- func GetCtxMetadataAuthorizationToken(ctx context.Context) (string, error)
- func GetCtxMetadataBearerToken(ctx context.Context, key string) (string, error)
- func GetCtxMetadataGCloudAuthorizationToken(ctx context.Context) (string, error)
- func GetCtxMetadataRefreshToken(ctx context.Context) (string, error)
- func GetCtxMetadataValue(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 SetCtxMetadataAccessToken(ctx context.Context, accessToken string) (context.Context, error)
- func SetCtxMetadataAuthorizationToken(ctx context.Context, token string) (context.Context, error)
- func SetCtxMetadataBearerToken(ctx context.Context, key, token string) (context.Context, error)
- func SetCtxMetadataGCloudAuthorizationToken(ctx context.Context, token string) (context.Context, error)
- func SetCtxMetadataRefreshToken(ctx context.Context, refreshToken string) (context.Context, 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
Constants ¶
This section is empty.
Variables ¶
var ( ErrNilMetadata = errors.New("missing metadata") ErrNilMetadataKeyValue = errors.New("metadata key value is nil") )
Functions ¶
func ClearCtxMetadataAccessToken ¶
ClearCtxMetadataAccessToken clears the access token from the context metadata
Parameters:
- ctx: The context to clear the token from
Returns:
- context.Context: The context with the token cleared
- error: An error if the metadata is not found or any other error occurs
func ClearCtxMetadataAuthorizationToken ¶
ClearCtxMetadataAuthorizationToken clears the authorization token from the context metadata
Parameters:
- ctx: The context to clear the token from
Returns:
- context.Context: The context with the token cleared
- error: An error if the metadata is not found or any other error occurs
func ClearCtxMetadataGCloudAuthorizationToken ¶
ClearCtxMetadataGCloudAuthorizationToken clears the GCloud authorization token from the context metadata
Parameters:
- ctx: The context to clear the token from
Returns:
- context.Context: The context with the token cleared
- error: An error if the metadata is not found or any other error occurs
func ClearCtxMetadataRefreshToken ¶
ClearCtxMetadataRefreshToken clears the refresh token from the context metadata
Parameters:
- ctx: The context to clear the token from
Returns:
- context.Context: The context with the token cleared
- error: An error if the metadata is not found or any other error occurs
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 DeleteCtxMetadataValue ¶
DeleteCtxMetadataValue deletes the value for a given key from the context metadata
Parameters:
- ctx: The context to get the metadata from
- key: The key to delete the value for
Returns:
- context.Context: The context with the value deleted
- error: An error if the key is not found or any other error occurs
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 GetCtxMetadata ¶
GetCtxMetadata gets the metadata from the context
Parameters:
- ctx: The context to get the metadata from
Returns:
- metadata.MD: The metadata from the context
- error: An error if the metadata is not found or any other error occurs
func GetCtxMetadataAccessToken ¶
GetCtxMetadataAccessToken gets the access token from the context metadata
Parameters:
- ctx: The 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 GetCtxMetadataAuthorizationToken ¶
GetCtxMetadataAuthorizationToken gets the authorization token from the context metadata
Parameters:
- ctx: The 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 GetCtxMetadataBearerToken ¶
GetCtxMetadataBearerToken gets the bearer token from the context metadata
Parameters:
- ctx: The 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 GetCtxMetadataGCloudAuthorizationToken ¶
GetCtxMetadataGCloudAuthorizationToken gets the GCloud authorization token from the context metadata
Parameters:
- ctx: The 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 GetCtxMetadataRefreshToken ¶
GetCtxMetadataRefreshToken gets the refresh token from the context metadata
Parameters:
- ctx: The 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 GetCtxMetadataValue ¶
GetCtxMetadataValue 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 SetCtxMetadataAccessToken ¶
SetCtxMetadataAccessToken sets the access token to the metadata
Parameters:
- ctx: The 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 SetCtxMetadataAuthorizationToken ¶
func SetCtxMetadataAuthorizationToken( ctx context.Context, token string, ) (context.Context, error)
SetCtxMetadataAuthorizationToken sets the authorization token to the metadata
Parameters:
- ctx: The context to set the token to
- token: The token to set
Returns:
- context.Context: The context with the token set
func SetCtxMetadataBearerToken ¶
SetCtxMetadataBearerToken sets the authorization token to the metadata
Parameters:
- ctx: The 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 SetCtxMetadataGCloudAuthorizationToken ¶
func SetCtxMetadataGCloudAuthorizationToken( ctx context.Context, token string, ) (context.Context, error)
SetCtxMetadataGCloudAuthorizationToken sets the GCloud authorization token to the metadata
Parameters:
- ctx: The 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 SetCtxMetadataRefreshToken ¶
func SetCtxMetadataRefreshToken( ctx context.Context, refreshToken string, ) (context.Context, error)
SetCtxMetadataRefreshToken sets the refresh token to the metadata
Parameters:
- ctx: The 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
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
Types ¶
This section is empty.