...
1 package context
2
3 import (
4 "context"
5
6 "github.com/aws/smithy-go/middleware"
7 )
8
9 type s3BackendKey struct{}
10 type checksumInputAlgorithmKey struct{}
11
12 const (
13
14 S3BackendS3Express = "S3Express"
15 )
16
17
18
19 func SetS3Backend(ctx context.Context, typ string) context.Context {
20 return middleware.WithStackValue(ctx, s3BackendKey{}, typ)
21 }
22
23
24 func GetS3Backend(ctx context.Context) string {
25 v, _ := middleware.GetStackValue(ctx, s3BackendKey{}).(string)
26 return v
27 }
28
29
30
31 func SetChecksumInputAlgorithm(ctx context.Context, value string) context.Context {
32 return middleware.WithStackValue(ctx, checksumInputAlgorithmKey{}, value)
33 }
34
35
36 func GetChecksumInputAlgorithm(ctx context.Context) string {
37 v, _ := middleware.GetStackValue(ctx, checksumInputAlgorithmKey{}).(string)
38 return v
39 }
40
View as plain text