mocks

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ComponentKey     = attribute.Key("component")      //nolint:gochecknoglobals
	ServiceKey       = attribute.Key("service")        //nolint:gochecknoglobals
	StatusCodeKey    = attribute.Key("status.code")    //nolint:gochecknoglobals
	StatusMessageKey = attribute.Key("status.message") //nolint:gochecknoglobals
	ErrorKey         = attribute.Key("error")          //nolint:gochecknoglobals
	NameKey          = attribute.Key("name")           //nolint:gochecknoglobals
)

Functions

This section is empty.

Types

type MockContextKeyValue

type MockContextKeyValue struct {
	Key   interface{}
	Value interface{}
}

type MockEvent

type MockEvent struct {
	Timestamp  time.Time
	Name       string
	Attributes []attribute.KeyValue
}
type MockLink struct {
	SpanContext trace.SpanContext
	Attributes  []attribute.KeyValue
}

type MockSpan

type MockSpan struct {
	embedded.Span

	SpanKind trace.SpanKind

	Attributes   []attribute.KeyValue
	StartTime    time.Time
	EndTime      time.Time
	ParentSpanID trace.SpanID
	Events       []MockEvent
	Links        []MockLink
	// contains filtered or unexported fields
}

func (*MockSpan) AddEvent

func (s *MockSpan) AddEvent(name string, o ...trace.EventOption)
func (s *MockSpan) AddLink(link trace.Link)

func (*MockSpan) End

func (s *MockSpan) End(options ...trace.SpanEndOption)

func (*MockSpan) IsRecording

func (s *MockSpan) IsRecording() bool

func (*MockSpan) OverrideTracer

func (s *MockSpan) OverrideTracer(tracer trace.Tracer)

func (*MockSpan) RecordError

func (s *MockSpan) RecordError(err error, opts ...trace.EventOption)

func (*MockSpan) SetAttributes

func (s *MockSpan) SetAttributes(attributes ...attribute.KeyValue)

func (*MockSpan) SetError

func (s *MockSpan) SetError(v bool)

func (*MockSpan) SetName

func (s *MockSpan) SetName(name string)

func (*MockSpan) SetStatus

func (s *MockSpan) SetStatus(code codes.Code, msg string)

func (*MockSpan) SpanContext

func (s *MockSpan) SpanContext() trace.SpanContext

func (*MockSpan) Tracer

func (s *MockSpan) Tracer() trace.Tracer

func (*MockSpan) TracerProvider

func (s *MockSpan) TracerProvider() trace.TracerProvider

type MockTracer

type MockTracer struct {
	embedded.Tracer

	FinishedSpans         []*MockSpan
	SpareTraceIDs         []trace.TraceID
	SpareSpanIDs          []trace.SpanID
	SpareContextKeyValues []MockContextKeyValue
	TraceFlags            trace.TraceFlags
	// contains filtered or unexported fields
}

func NewMockTracer

func NewMockTracer() *MockTracer

func (*MockTracer) DeferredContextSetupHook

func (t *MockTracer) DeferredContextSetupHook(ctx context.Context, _ trace.Span) context.Context

func (*MockTracer) Reset

func (t *MockTracer) Reset()

func (*MockTracer) Start

func (t *MockTracer) Start(ctx context.Context, _ string, opts ...trace.SpanStartOption) (
	context.Context, trace.Span,
)

type MockTracerProvider

type MockTracerProvider struct {
	embedded.TracerProvider
	// contains filtered or unexported fields
}

func NewMockTraceProvider

func NewMockTraceProvider() *MockTracerProvider

func (*MockTracerProvider) Tracer

Jump to

Keyboard shortcuts

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