rkgrpcmeta

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package rkgrpcmeta is a middleware of grpc framework for adding metadata in RPC response

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StreamServerInterceptor

func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor

StreamServerInterceptor Add common headers as extension style in http response. The key is defined as bellow: 1: X-Request-Id: Request id generated by interceptor. 2: X-<Prefix-App: Application name. 3: X-<Prefix>-App-Version: Version of application. 4: X-<Prefix>-App-Unix-Time: Unix time of current application. 5: X-<Prefix>-Request-Received-Time: Time of current request received by application.

func UnaryServerInterceptor

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

UnaryServerInterceptor Add common headers as extension style in http response. The key is defined as bellow: 1: X-Request-Id: Request id generated by interceptor. 2: X-<Prefix-App: Application name. 3: X-<Prefix>-App-Version: Version of application. 4: X-<Prefix>-App-Unix-Time: Unix time of current application. 5: X-<Prefix>-Request-Received-Time: Time of current request received by application.

Types

type Option

type Option func(*optionSet)

Option option for optionSet

func WithEntryNameAndType

func WithEntryNameAndType(entryName, entryType string) Option

WithEntryNameAndType Provide entry name and entry type.

func WithPrefix

func WithPrefix(prefix string) Option

WithPrefix Provide prefix.

Jump to

Keyboard shortcuts

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