mock

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithSpan

func ContextWithSpan(ctx context.Context, s sdk.Span) context.Context

func SpanFromContext

func SpanFromContext(ctx context.Context) sdk.Span

func StartSpan

func StartSpan(ctx context.Context, name string, opts *sdk.SpanOptions) (context.Context, sdk.Span, func())

Types

type Filter

type Filter struct {
	URLAndHeadersEvaluator func(span sdk.Span, url string, headers map[string][]string) bool
	BodyEvaluator          func(span sdk.Span, body []byte, headers map[string][]string) bool
}

func (Filter) EvaluateBody

func (f Filter) EvaluateBody(span sdk.Span, body []byte, headers map[string][]string) bool

func (Filter) EvaluateURLAndHeaders

func (f Filter) EvaluateURLAndHeaders(span sdk.Span, url string, headers map[string][]string) bool

type Span

type Span struct {
	Name       string
	Attributes map[string]interface{}
	Options    sdk.SpanOptions
	Err        error
	Noop       bool
	Status     Status
	// contains filtered or unexported fields
}

func NewSpan

func NewSpan() *Span

func (*Span) IsNoop

func (s *Span) IsNoop() bool

func (*Span) ReadAttribute

func (s *Span) ReadAttribute(key string) interface{}

func (*Span) RemainingAttributes

func (s *Span) RemainingAttributes() int

func (*Span) SetAttribute

func (s *Span) SetAttribute(key string, value interface{})

func (*Span) SetError

func (s *Span) SetError(err error)

func (*Span) SetStatus added in v0.5.0

func (s *Span) SetStatus(code sdk.Code, description string)

type Status added in v0.5.0

type Status struct {
	Code    sdk.Code
	Message string
}

Jump to

Keyboard shortcuts

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