rkmuxmeta

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package rkmuxmeta is a middleware of mux framework for adding metadata in RPC response

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Interceptor

func Interceptor(opts ...Option) mux.MiddlewareFunc

Interceptor will 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 if for middleware options while creating middleware

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