mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-14 02:10:21 +00:00
40ad4163cb
Bumps the github-dependencies group with 2 updates: [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2) and [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang). Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.30.7 to 1.31.1 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/service/s3/v1.31.1/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/service/mgn/v1.30.7...service/s3/v1.31.1) Updates `github.com/prometheus/client_golang` from 1.20.3 to 1.20.4 - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.20.3...v1.20.4) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/sts dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
42 lines
1.4 KiB
Go
42 lines
1.4 KiB
Go
package middleware
|
|
|
|
import "context"
|
|
|
|
type (
|
|
serviceIDKey struct{}
|
|
operationNameKey struct{}
|
|
)
|
|
|
|
// WithServiceID adds a service ID to the context, scoped to middleware stack
|
|
// values.
|
|
//
|
|
// This API is called in the client runtime when bootstrapping an operation and
|
|
// should not typically be used directly.
|
|
func WithServiceID(parent context.Context, id string) context.Context {
|
|
return WithStackValue(parent, serviceIDKey{}, id)
|
|
}
|
|
|
|
// GetServiceID retrieves the service ID from the context. This is typically
|
|
// the service shape's name from its Smithy model. Service clients for specific
|
|
// systems (e.g. AWS SDK) may use an alternate designated value.
|
|
func GetServiceID(ctx context.Context) string {
|
|
id, _ := GetStackValue(ctx, serviceIDKey{}).(string)
|
|
return id
|
|
}
|
|
|
|
// WithOperationName adds the operation name to the context, scoped to
|
|
// middleware stack values.
|
|
//
|
|
// This API is called in the client runtime when bootstrapping an operation and
|
|
// should not typically be used directly.
|
|
func WithOperationName(parent context.Context, id string) context.Context {
|
|
return WithStackValue(parent, operationNameKey{}, id)
|
|
}
|
|
|
|
// GetOperationName retrieves the operation name from the context. This is
|
|
// typically the operation shape's name from its Smithy model.
|
|
func GetOperationName(ctx context.Context) string {
|
|
name, _ := GetStackValue(ctx, operationNameKey{}).(string)
|
|
return name
|
|
}
|