thriftbp

package
v0.0.0-...-bde19ca Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package thriftbp provides Baseplate specific thrift related helpers.

Index

Constants

View Source
const (
	// The Trace ID, a 64-bit integer encoded in decimal.
	HeaderTracingTrace = "Trace"
	// The Span ID, a 64-bit integer encoded in decimal.
	HeaderTracingSpan = "Span"
	// The Parent Span ID, a 64-bit integer encoded in decimal.
	HeaderTracingParent = "Parent"
	// The Sampled flag, an ASCII "1" (HeaderTracingSampledTrue) if true, otherwise false.
	// If not present, defaults to false.
	HeaderTracingSampled = "Sampled"
	// Trace flags, a 64-bit integer encoded in decimal.
	// If not present, defaults to null.
	HeaderTracingFlags = "Flags"
)

Tracing related headers, as defined in https://pages.github.snooguts.net/'.spec/component-apis/thrift#tracing

View Source
const (
	HeaderEdgeRequest = "Edge-Request"
)

Edge request context propagation related headers, as defined in https://pages.github.snooguts.net/'.spec/component-apis/thrift#edge-request-context-propagation

View Source
const HeaderTracingSampledTrue = "1"

HeaderTracingSampledTrue is the header value to indicate that this trace should be sampled.

Variables

HeadersToForward are the headers that should always be forwarded to upstream thrift servers, to be used in thrift.TSimpleServer.SetForwardHeaders.

Functions

func Merge

func Merge(processors ...MergeableTProcessor) thrift.TProcessor

Merge merges together the specified processors.

It's useful if the server need to support two separated thrift files.

It's kind of like Apache Thrift's TMultiplexedProcessor, the key difference is that TMultiplexedProcessor requires the client to also use TMultiplexedProtocol, while here the client didn't need any special handling.

Types

type MergeableTProcessor

type MergeableTProcessor interface {
	Process(ctx context.Context, in, out thrift.TProtocol) (bool, thrift.TException)
	AddToProcessorMap(key string, processor thrift.TProcessorFunction)
	ProcessorMap() map[string]thrift.TProcessorFunction
}

MergeableTProcessor interface contains the functions needed to merge processors together.

It is used by the Merge function below.

Jump to

Keyboard shortcuts

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