http

package
v0.0.0-...-f35223c Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package http contains several client/server http plugin which can be used for integration with net/http.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(tracer *pobpgo.Tracer, options ...ClientOption) (*http.Client, error)

NewClient returns an HTTP Client with tracer

func NewServerMiddleware

func NewServerMiddleware(tracer *pobpgo.Tracer, options ...ServerOption) (func(http.Handler) http.Handler, error)

NewServerMiddleware returns a http.Handler middleware with tracing.

Types

type ClientConfig

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

type ClientOption

type ClientOption func(*ClientConfig)

ClientOption allows optional configuration of Client.

func WithClient

func WithClient(client *http.Client) ClientOption

WithClient set customer http client.

func WithClientOperationName

func WithClientOperationName(name string) ClientOption

WithOperationName override default operation name.

func WithClientTag

func WithClientTag(key string, value string) ClientOption

WithClientTag adds extra tag to client spans.

type ServerOption

type ServerOption func(*handler)

ServerOption allows Middleware to be optionally configured.

func WithServerOperationName

func WithServerOperationName(name string) ServerOption

WithOperationName override default operation name.

func WithServerTag

func WithServerTag(key string, value string) ServerOption

Tag adds extra tag to server spans.

Jump to

Keyboard shortcuts

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