context

package
v0.0.0-...-5e24cfe Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package context provides a context for accessing services

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultContext is a context which can be used to access micro services
	DefaultContext = WithNamespace("micro")
)

Functions

func GetMetadata

func GetMetadata(ctx context.Context, k string) (string, bool)

GetMetadata returns metadata from the context

func SetMetadata

func SetMetadata(ctx context.Context, k, v string) context.Context

SetMetadata sets the metadata within the context

func SetNamespace

func SetNamespace(ctx context.Context, ns string) context.Context

SetNamespace sets the namespace for a context

func WithNamespace

func WithNamespace(ns string) context.Context

WithNamespace creates a new context with the given namespace

Types

This section is empty.

Directories

Path Synopsis
Package metadata is a way of defining message headers
Package metadata is a way of defining message headers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL