tracygo

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

README

tracygo

How to import

import "github.com/Clarilab/tracygo"

How to use

Check the main.go in the example folder. There are two middleware functions for atreugo. UseBefore(CheckRequestID) which checks if the IDs are set if not its creates and saves them in the Uservalues. UseAfter(WriteHeader) which writes the the userValues into the response Header.

There is one resty middleware. OnBeforeRequest(CheckTracingIDs) which checks if the IDs are set and writes them into the Header.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(tracy *TracyGo)

Option is an optional func.

func CorrelationID added in v1.0.3

func CorrelationID(id string) Option

CorrelationID returns a function that sets the key for the correlationId header.

func RequestID added in v1.0.3

func RequestID(id string) Option

RequestID returns a function that sets the key for the requestId header.

type TracyGo

type TracyGo struct {
	// contains filtered or unexported fields
}

TracyGo is a struct for the tracy object.

func New

func New(options ...Option) *TracyGo

New creates a new TracyGo object and uses the options on it.

func (*TracyGo) AtreugoCheckTracingIDs added in v1.0.3

func (t *TracyGo) AtreugoCheckTracingIDs(ctx *atreugo.RequestCtx) error

AtreugoCheckTracingIDs is a useBefore middleware for atreugo that checks if a correlationID and requestID have been set and creates a new one if they have not been set yet.

func (*TracyGo) RestyCheckTracingIDs added in v1.0.3

func (t *TracyGo) RestyCheckTracingIDs(client *resty.Client, request *resty.Request) error

RestyCheckTracingIDs is a OnBeforeRequest middleware for resty which check if the context has the tracing ids set. If they are set, they should be put into the request headers.

Directories

Path Synopsis
middleware
atreugo Module
fiber Module
resty Module

Jump to

Keyboard shortcuts

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