grpcid

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package grpcid provides a gRPC middleware interceptor that adds a string ID to the request context.

Index

Constants

View Source
const (
	// DefaultTag is the default tag name used.
	DefaultTag = "correlation.id"
)

Variables

This section is empty.

Functions

func UnaryServerInterceptor

func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor

UnaryServerInterceptor creates a unary server interceptor for gRPC that adds a string ID to the request context.

Types

type Option

type Option func(*config)

Option is a grpcid interceptor option.

func Generator

func Generator(g stringid.Generator) Option

Generator is a grpcid interceptor option to set the string ID generator to use.

func Tag

func Tag(tag string) Option

Tag is a grpcid interceptor option to set the tag name used.

Jump to

Keyboard shortcuts

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