Documentation
¶
Index ¶
- Constants
- Variables
- func DecodePropagationContext(encoded string) (*divergev1alpha1.PropagationContext, error)
- func EncodePropagationContext(ctx *divergev1alpha1.PropagationContext) (string, error)
- func EnvironmentFromContext(ctx context.Context) string
- func GetHeaderKey() string
- func WithEnvironment(ctx context.Context, envName string) context.Context
Constants ¶
View Source
const BinaryHeaderKey = "x-diverge-context-bin"
BinaryHeaderKey is the HTTP header key used to propagate the binary context.
View Source
const DefaultHeaderKey = "x-diverge-env"
DefaultHeaderKey is used to extract the preview environment name from the HTTP header.
Variables ¶
View Source
var EnvContextKey = envContextKey{}
EnvContextKey is the key used to store the environment name in a context.
Functions ¶
func DecodePropagationContext ¶ added in v0.7.0
func DecodePropagationContext(encoded string) (*divergev1alpha1.PropagationContext, error)
DecodePropagationContext decodes a base64 string and unmarshals it into a PropagationContext.
func EncodePropagationContext ¶ added in v0.7.0
func EncodePropagationContext(ctx *divergev1alpha1.PropagationContext) (string, error)
EncodePropagationContext marshals a PropagationContext to protobuf and encodes it as base64.
func EnvironmentFromContext ¶
EnvironmentFromContext extracts the environment name from the context.
func GetHeaderKey ¶ added in v0.5.0
func GetHeaderKey() string
GetHeaderKey returns the header key from DIVERGE_HEADER_KEY or DefaultHeaderKey.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.