Package: checksum
Constants
-
const AlgorithmCRC32C Algorithm = readonly
AlgorithmCRC32C represents CRC32C hash algorithm
-
Value:
"CRC32C" -
const AlgorithmCRC32 Algorithm = readonly
AlgorithmCRC32 represents CRC32 hash algorithm
-
Value:
"CRC32" -
const AlgorithmSHA1 Algorithm = readonly
AlgorithmSHA1 represents SHA1 hash algorithm
-
Value:
"SHA1" -
const AlgorithmSHA256 Algorithm = readonly
AlgorithmSHA256 represents SHA256 hash algorithm
-
Value:
"SHA256" -
const AlgorithmCRC64NVME Algorithm = readonly
AlgorithmCRC64NVME represents CRC64NVME hash algorithm
-
Value:
"CRC64NVME"
Type Summary collapse
- Algorithm struct
-
ComputeInputPayloadChecksum
struct
ComputeInputPayloadChecksum middleware computes payload checksum.
-
InputMiddlewareOptions
struct
InputMiddlewareOptions provides the options for the request checksum middleware setup.
-
OutputMiddlewareOptions
struct
OutputMiddlewareOptions provides options for configuring output checksum validation middleware.
-
RequestChecksumMetricsTracking
struct
RequestChecksumMetricsTracking is the middleware to track operation request’s checksum usage.
-
ResponseChecksumMetricsTracking
struct
ResponseChecksumMetricsTracking is the middleware to track operation response’s checksum usage.
-
SetupInputContext
struct
SetupInputContext is the initial middleware that looks up the input used to configure checksum behavior.
Function Summary collapse
-
func AddInputMiddleware(stack *middleware.Stack, options InputMiddlewareOptions) (err error)
AddInputMiddleware adds the middleware for performing checksum computing of request payloads, and checksum validation of response payloads.
-
func AddOutputMiddleware(stack *middleware.Stack, options OutputMiddlewareOptions) error
AddOutputMiddleware adds the middleware for validating response payload’s checksum.
-
func AlgorithmChecksumLength(v Algorithm) (int, error)
AlgorithmChecksumLength returns the length of the algorithm’s checksum in bytes.
-
func AlgorithmHTTPHeader(v Algorithm) string
AlgorithmHTTPHeader returns the HTTP header for the algorithm’s hash.
-
func FilterSupportedAlgorithms(vs []string) []Algorithm
FilterSupportedAlgorithms filters the set of algorithms, returning a slice of algorithms that are supported.
-
func GetComputedInputChecksums(m middleware.Metadata) (map[string]string, bool)
GetComputedInputChecksums returns the map of checksum algorithm to their computed value stored in the middleware Metadata.
-
func GetOutputValidationAlgorithmsUsed(m middleware.Metadata) ([]string, bool)
GetOutputValidationAlgorithmsUsed returns the checksum algorithms used stored in the middleware Metadata.
-
func NewAlgorithmHash(v Algorithm) (hash.Hash, error)
NewAlgorithmHash returns a hash.Hash for the checksum algorithm.
-
func RemoveInputMiddleware(stack *middleware.Stack)
RemoveInputMiddleware Removes the compute input payload checksum middleware handlers from the stack.
-
func RemoveOutputMiddleware(stack *middleware.Stack)
RemoveOutputMiddleware Removes the compute input payload checksum middleware handlers from the stack.
-
func SetComputedInputChecksums(m *middleware.Metadata, vs map[string]string)
SetComputedInputChecksums stores the map of checksum algorithm to their computed value in the middleware Metadata.
-
func SetOutputValidationAlgorithmsUsed(m *middleware.Metadata, vs []string)
SetOutputValidationAlgorithmsUsed stores the checksum algorithms used in the middleware Metadata.
Type Details
Algorithm struct
InputMiddlewareOptions struct
InputMiddlewareOptions provides the options for the request checksum middleware setup.
OutputMiddlewareOptions struct
OutputMiddlewareOptions provides options for configuring output checksum validation middleware.
Function Details
func AddInputMiddleware(stack *middleware.Stack, options InputMiddlewareOptions) (err error)
AddInputMiddleware adds the middleware for performing checksum computing of request payloads, and checksum validation of response payloads.
Deprecated: This internal-only runtime API is frozen. Do not call or modify it in new code. Checksum-enabled service operations now generate this middleware setup code inline per #2507.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
// File 'service/internal/checksum/middleware_add.go', line 58
|
func AddOutputMiddleware(stack *middleware.Stack, options OutputMiddlewareOptions) error
AddOutputMiddleware adds the middleware for validating response payload’s checksum.
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
// File 'service/internal/checksum/middleware_add.go', line 143
|
func AlgorithmChecksumLength(v Algorithm) (int, error)
AlgorithmChecksumLength returns the length of the algorithm’s checksum in bytes. If the algorithm is not known, an error is returned.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
// File 'service/internal/checksum/algorithms.go', line 108
|
func AlgorithmHTTPHeader(v Algorithm) string
AlgorithmHTTPHeader returns the HTTP header for the algorithm’s hash.
128 129 130 |
// File 'service/internal/checksum/algorithms.go', line 128
|
func FilterSupportedAlgorithms(vs []string) []Algorithm
FilterSupportedAlgorithms filters the set of algorithms, returning a slice of algorithms that are supported.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
// File 'service/internal/checksum/algorithms.go', line 65
|
func GetComputedInputChecksums(m middleware.Metadata) (map[string]string, bool)
GetComputedInputChecksums returns the map of checksum algorithm to their computed value stored in the middleware Metadata. Returns false if no values were stored in the Metadata.
29 30 31 32 |
// File 'service/internal/checksum/middleware_compute_input_checksum.go', line 29
|
func GetOutputValidationAlgorithmsUsed(m middleware.Metadata) ([]string, bool)
GetOutputValidationAlgorithmsUsed returns the checksum algorithms used stored in the middleware Metadata. Returns false if no algorithms were stored in the Metadata.
21 22 23 24 |
// File 'service/internal/checksum/middleware_validate_output.go', line 21
|
func NewAlgorithmHash(v Algorithm) (hash.Hash, error)
NewAlgorithmHash returns a hash.Hash for the checksum algorithm. Error is returned if the algorithm is unknown.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
// File 'service/internal/checksum/algorithms.go', line 89
|
func RemoveInputMiddleware(stack *middleware.Stack)
RemoveInputMiddleware Removes the compute input payload checksum middleware handlers from the stack.
97 98 99 100 101 102 103 |
// File 'service/internal/checksum/middleware_add.go', line 97
|
func RemoveOutputMiddleware(stack *middleware.Stack)
RemoveOutputMiddleware Removes the compute input payload checksum middleware handlers from the stack.
168 169 170 171 172 173 174 |
// File 'service/internal/checksum/middleware_add.go', line 168
|
func SetComputedInputChecksums(m *middleware.Metadata, vs map[string]string)
SetComputedInputChecksums stores the map of checksum algorithm to their computed value in the middleware Metadata. Overwrites any values that currently exist in the metadata.
37 38 39 |
// File 'service/internal/checksum/middleware_compute_input_checksum.go', line 37
|
func SetOutputValidationAlgorithmsUsed(m *middleware.Metadata, vs []string)
SetOutputValidationAlgorithmsUsed stores the checksum algorithms used in the middleware Metadata.
28 29 30 |
// File 'service/internal/checksum/middleware_validate_output.go', line 28
|