Documentation ¶
Overview ¶
Package kv provides a way to work with keys and values. Those let keep the consistency among packages when working with key-value pairs. Functionality for some pre-defined context attributes is also provided.
Index ¶
- func DecorateWithAttributes(inUse, background context.Context) context.Context
- func SetDynamicAttributes(ctx context.Context, correlationID string, isDryRun bool) context.Context
- func SetStaticAttributes(ctx context.Context, buildID, serviceHost, serviceName string) context.Context
- type Pair
- type Val
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecorateWithAttributes ¶ added in v2.4.0
DecorateWithAttributes adds the static attributes as values in the resulting context.
Types ¶
type Pair ¶
type Pair struct { Val // contains filtered or unexported fields }
Pair encapsulates a key-value representation. All Val methods can be accessed from a Pair.
func AllAttributes ¶ added in v2.4.0
AllAttributes returns all the known pairs that exist in the context.
func CorrelationID ¶
CorrelationID returns pair holding that information from the given context.
func NewObfuscated ¶
NewObfuscated generates a new Pair using the given key. The value, however, will be obfuscated. This prevents situations where a value is not supposed to be reported to other components. Only strings are supported at this time.
type Val ¶
type Val struct {
// contains filtered or unexported fields
}
Val encapsulates the given value. Keeping it encapsulated allows to work with obfuscated pairs. A value can also be used on its own.