eventsources

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceNameTag   string = "vs.source.name"
	SpanIDTag       string = "vs.span.id"
	ParentSpanIDTag string = "vs.parent.span.id"
)
View Source
const (
	TracePrefix string = "vstrace"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event interface {
	SpanID() (string, error)
	OperationName() string
	ParentSpanID() (*string, error)
	IsError() (bool, error)
	State(prev *EventState) (SpanState, error)
	Tags() (map[string]interface{}, error)
	Timings() (EventTimings, error)
}

type EventSource

type EventSource interface {
	Name() string
	ValidatePayload(r *http.Request, secretKey []byte) ([]byte, error)
	Event(r *http.Request, payload []byte) (Event, error)
	Tracer() opentracing.Tracer
	SecretKey() []byte
}

type EventState

type EventState string

type EventTimings added in v0.3.0

type EventTimings struct {
	StartTime *time.Time
	EndTime   *time.Time
	Duration  *time.Duration
}

type SpanState

type SpanState string
const (
	StartState        SpanState = "start"
	EndState          SpanState = "end"
	IntermediaryState SpanState = "intermediary"
	TransitionState   SpanState = "transition"
	UnknownState      SpanState = "unknown"
)

type StubEvent

type StubEvent struct {
	SpanIDReturn            string
	SpanIDReturnError       error
	OperationNameReturn     string
	ParentSpanIDReturn      *string
	ParentSpanIDReturnError error
	IsErrorReturn           bool
	IsErrorReturnError      error
	StateReturn             SpanState
	StateReturnError        error
	TraceIDReturn           *string
	TraceIDReturnError      error
	TagsReturn              map[string]interface{}
	TagsReturnError         error
}

func (StubEvent) IsError

func (s StubEvent) IsError() (bool, error)

func (StubEvent) OperationName

func (s StubEvent) OperationName() string

func (StubEvent) ParentSpanID

func (s StubEvent) ParentSpanID() (*string, error)

func (StubEvent) SpanID

func (s StubEvent) SpanID() (string, error)

func (StubEvent) State

func (s StubEvent) State(prev *EventState) (SpanState, error)

func (StubEvent) Tags

func (s StubEvent) Tags() (map[string]interface{}, error)

func (StubEvent) Timings added in v0.3.0

func (s StubEvent) Timings() (EventTimings, error)

func (StubEvent) TraceID

func (s StubEvent) TraceID() (*string, error)

type StubEventSource

type StubEventSource struct {
	ValidatePayloadFn func(r *http.Request, secretKey []byte) ([]byte, error)
	NameReturn        string
	EventFn           func(*http.Request, []byte) (Event, error)
	TracerReturn      opentracing.Tracer
	SecretKeyReturn   []byte
}

func (StubEventSource) Event

func (s StubEventSource) Event(r *http.Request, payload []byte) (Event, error)

func (StubEventSource) Name

func (s StubEventSource) Name() string

func (StubEventSource) SecretKey

func (s StubEventSource) SecretKey() []byte

func (StubEventSource) Tracer

func (s StubEventSource) Tracer() opentracing.Tracer

func (StubEventSource) ValidatePayload

func (s StubEventSource) ValidatePayload(r *http.Request, secretKey []byte) ([]byte, error)

type TestEvent

type TestEvent struct {
	Headers map[string]string
	Payload interface{}
}

func NewTestEventFromFixturePath

func NewTestEventFromFixturePath(path string) (*TestEvent, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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