...
1 package http
2
3 import (
4 "context"
5
6 "github.com/aws/smithy-go/middleware"
7 )
8
9 type (
10 hostnameImmutableKey struct{}
11 hostPrefixDisableKey struct{}
12 )
13
14
15
16
17
18
19 func GetHostnameImmutable(ctx context.Context) (v bool) {
20 v, _ = middleware.GetStackValue(ctx, hostnameImmutableKey{}).(bool)
21 return v
22 }
23
24
25
26
27
28
29 func SetHostnameImmutable(ctx context.Context, value bool) context.Context {
30 return middleware.WithStackValue(ctx, hostnameImmutableKey{}, value)
31 }
32
33
34
35
36
37
38 func IsEndpointHostPrefixDisabled(ctx context.Context) (v bool) {
39 v, _ = middleware.GetStackValue(ctx, hostPrefixDisableKey{}).(bool)
40 return v
41 }
42
43
44
45
46
47
48
49 func DisableEndpointHostPrefix(ctx context.Context, value bool) context.Context {
50 return middleware.WithStackValue(ctx, hostPrefixDisableKey{}, value)
51 }
52
View as plain text