package
0.2.1
Repository: https://github.com/donewscode/core-kit.git
Documentation: pkg.go.dev

# Functions

ContextToGRPC moves a CorrelationID from context to grpc metadata.
ContextToHTTP moves a CorrelationID from context to request header.
GRPCToContext moves a CorrelationID from grpc metadata to context.
HTTPToContext moves a CorrelationID from request header to context.
MakeAttempt returns a middleware that wraps around an attempt endpoint.
MakeCancel returns a middleware that wraps around the cancellation endpoint.
MakeIdempotence returns a middleware that ensures the next endpoint can only be executed once per CorrelationID.
MakeLock returns a middleware that ensures the next endpoint is never concurrently accessed.

# Variables

ErrNoLock is returned when the endpoint fail to fetch the distributed lock under the same CorrelationID.
ErrNonIdempotent is returned when an endpoint is requested more than once with the same CorrelationID.

# Structs

RedisStore is an implementation of Oncer, Locker and Sequencer.

# Interfaces

Locker is an interface for the distributed lock.
Oncer should return true if the key has been observed before.
Sequencer is an interface that shields against the disordering of attempt and cancel in a transactional context.