context

package
v3.10.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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