Documentation
¶
Overview ¶
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0 Modifications Copyright National Payments Corporation of India
Index ¶
- func ComputeSHA256(data []byte) (hash []byte)
- func ComputeSHA3256(data []byte) (hash []byte)
- func ConcatenateBytes(data ...[]byte) []byte
- func CreateUtcTimestamp() *timestamp.Timestamp
- func ExponentialBackoffRetry(operation func() error, maxRetries int, initialDelay time.Duration) error
- func ExtractCertificateFromContext(ctx context.Context) *x509.Certificate
- func ExtractCertificateHashFromContext(ctx context.Context) []byte
- func ExtractRawCertificateFromContext(ctx context.Context) []byte
- func ExtractRemoteAddress(ctx context.Context) string
- func GenerateBytesUUID() []byte
- func GenerateUUID() string
- func ToChaincodeArgs(args ...string) [][]byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeSHA256 ¶
ComputeSHA256 returns SHA2-256 on data
func ComputeSHA3256 ¶
ComputeSHA3256 returns SHA3-256 on data
func ConcatenateBytes ¶
ConcatenateBytes is useful for combining multiple arrays of bytes, especially for signatures or digests over multiple fields
func CreateUtcTimestamp ¶
CreateUtcTimestamp returns a google/protobuf/Timestamp in UTC
func ExponentialBackoffRetry ¶
func ExponentialBackoffRetry(operation func() error, maxRetries int, initialDelay time.Duration) error
DRUNIX
ExponentialBackoffRetry attempts to execute the given operation function with an exponential backoff retry mechanism. If the operation fails, it will retry up to maxRetries times, with an initial delay that doubles after each retry. Parameters: - operation: The function to be executed, which returns an error if it fails. - maxRetries: The maximum number of retry attempts. - initialDelay: The initial delay duration before the first retry, which will double after each subsequent retry. Returns: - error: The error returned by the operation function if all retry attempts fail, or nil if the operation succeeds.
func ExtractCertificateFromContext ¶
func ExtractCertificateFromContext(ctx context.Context) *x509.Certificate
ExtractCertificateFromContext returns the TLS certificate (if applicable) from the given context of a gRPC stream
func ExtractCertificateHashFromContext ¶
ExtractCertificateHashFromContext extracts the hash of the certificate from the given context. If the certificate isn't present, nil is returned
func ExtractRawCertificateFromContext ¶
ExtractRawCertificateFromContext returns the raw TLS certificate (if applicable) from the given context of a gRPC stream
func ExtractRemoteAddress ¶
func GenerateBytesUUID ¶
func GenerateBytesUUID() []byte
GenerateBytesUUID returns a UUID based on RFC 4122 returning the generated bytes
func ToChaincodeArgs ¶
ToChaincodeArgs converts string args to []byte args
Types ¶
This section is empty.