context

package
v1.0.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 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