uuid

package
v0.0.0-...-db1d4b8 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

Trace/UUID Plugin

The trace/uuid plugin adds a X-Micro-Trace-Id header with a uuid if it does not exist.

Usage

Register the plugin before building Micro

package main

import (
	"gitee.com/liuxuezhan/go-micro-v1.18.0/plugin"
	"gitee.com/liuxuezhan/go-plugins/micro/trace/uuid"
)

func init() {
	plugin.Register(uuid.New())
}
Scoped to API

If you like to only apply the plugin for a specific component you can register it with that specifically. For example, below you'll see the plugin registered with the API.

package main

import (
	"gitee.com/liuxuezhan/go-micro-v1.18.0/api"
	"gitee.com/liuxuezhan/go-plugins/micro/trace/uuid"
)

func init() {
	api.Register(uuid.New())
}

Documentation

Overview

Package uuid is a micro plugin for adding a trace header

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() plugin.Plugin

Types

This section is empty.

Jump to

Keyboard shortcuts

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