Documentation
¶
Index ¶
- Constants
- func EnsureEmpty(r io.Reader, stage string) error
- func GetAPIEnvironment(endpoint *RouterEndpoint, r *http.Request) string
- func GetBuffer() *bytes.Buffer
- func GetCtxLogCounterFromCtx(ctx context.Context) int
- func GetCtxLogLevelOrDebugLevelFromCtx(ctx context.Context) zapcore.Level
- func GetDirnameFromRuntimeCaller(file string) string
- func GetEndpointRequestHeadersFromCtx(ctx context.Context) map[string]string
- func GetHostname() string
- func GetLogFieldsFromCtx(ctx context.Context) []zap.Field
- func GetRequestEndpointFromCtx(ctx context.Context) string
- func GetRoutingDelegateFromCtx(ctx context.Context) string
- func GetScopeTagsFromCtx(ctx context.Context) map[string]string
- func GetShardKeyFromCtx(ctx context.Context) string
- func LogErrorWarnTimeout(logger *zap.Logger, err error, msg string)deprecated
- func NewTChannelLogger(logger *zap.Logger) tchannel.Logger
- func NewTChannelStatsReporter(scope tally.Scope) tchannel.StatsReporter
- func ParamsFromContext(ctx context.Context) url.Values
- func PutBuffer(buf *bytes.Buffer)
- func ReadHeaders(r io.Reader) (map[string]string, error)
- func ReadStruct(reader io.Reader, s RWTStruct) error
- func RequestUUIDFromCtx(ctx context.Context) string
- func WithEndpointField(ctx context.Context, endpoint string) context.Context
- func WithEndpointRequestHeadersField(ctx context.Context, requestHeaders map[string]string) context.Context
- func WithLogFields(ctx context.Context, newFields ...zap.Field) context.Context
- func WithRoutingDelegate(ctx context.Context, rd string) context.Context
- func WithScopeTags(ctx context.Context, newFields map[string]string) context.Context
- func WithShardKey(ctx context.Context, sk string) context.Context
- func WriteHeaders(w io.Writer, headers map[string]string) error
- type ClientHTTPRequest
- func (req *ClientHTTPRequest) CheckHeaders(expected []string) error
- func (req *ClientHTTPRequest) Do() (*ClientHTTPResponse, error)
- func (req *ClientHTTPRequest) InjectSpanToHeader(span opentracing.Span, format interface{}) error
- func (req *ClientHTTPRequest) WriteBytes(method, url string, headers map[string]string, rawBody []byte) error
- func (req *ClientHTTPRequest) WriteJSON(method, url string, headers map[string]string, body interface{}) error
- type ClientHTTPResponse
- func (res *ClientHTTPResponse) CheckOKResponse(okResponses []int)
- func (res *ClientHTTPResponse) GetRawBody() []byte
- func (res *ClientHTTPResponse) ReadAll() ([]byte, error)
- func (res *ClientHTTPResponse) ReadAndUnmarshalBody(v interface{}) error
- func (res *ClientHTTPResponse) ReadAndUnmarshalBodyMultipleOptions(vs []interface{}) (interface{}, error)
- func (res *ClientHTTPResponse) UnmarshalBody(v interface{}, rawBody []byte) error
- type ConfigOption
- type ContextExtractor
- type ContextExtractors
- type ContextLogFieldsExtractor
- type ContextLogger
- type ContextMetrics
- type ContextScopeTagsExtractor
- type DefaultDependencies
- type GRPCClientCallHelper
- type GRPCClientOpts
- type Gateway
- func (gateway *Gateway) Bootstrap() error
- func (gateway *Gateway) Close()
- func (gateway *Gateway) InspectOrDie() map[string]interface{}
- func (gateway *Gateway) SetupClientTChannel(config *StaticConfig, serviceName string) *tchannel.Channel
- func (gateway *Gateway) Shutdown()
- func (gateway *Gateway) ShutdownTimeout() time.Duration
- func (gateway *Gateway) SubLogger(name string, level zapcore.Level) *zap.Logger
- func (gateway *Gateway) Wait()
- type HTTPClient
- type HTTPRouter
- type HTTPServer
- type HandlerFn
- type Header
- type Logger
- type MiddlewareHandle
- type MiddlewareStack
- type MiddlewareTchannelHandle
- type MiddlewareTchannelStack
- type Options
- type PostResponseCB
- type RWTStruct
- type RawTChannelClient
- type RouterEndpoint
- type RuntimeMetricsCollector
- type RuntimeMetricsOptions
- type ServerHTTPHeader
- func (zh ServerHTTPHeader) Add(key string, value string)
- func (zh ServerHTTPHeader) Ensure(keys []string, logger *zap.Logger) errordeprecated
- func (zh ServerHTTPHeader) EnsureContext(ctx context.Context, keys []string, logger ContextLogger) error
- func (zh ServerHTTPHeader) Get(key string) (string, bool)
- func (zh ServerHTTPHeader) GetAll(key string) []string
- func (zh ServerHTTPHeader) GetOrEmptyStr(key string) string
- func (zh ServerHTTPHeader) Keys() []string
- func (zh ServerHTTPHeader) Set(key string, value string)
- func (zh ServerHTTPHeader) Unset(key string)
- func (zh ServerHTTPHeader) Values(key string) ([]string, bool)
- type ServerHTTPRequest
- func (req *ServerHTTPRequest) CheckHeaders(headers []string) bool
- func (req *ServerHTTPRequest) CheckQueryValue(key string) bool
- func (req *ServerHTTPRequest) Context() context.Context
- func (req *ServerHTTPRequest) GetQueryBool(key string) (bool, bool)
- func (req *ServerHTTPRequest) GetQueryBoolList(key string) ([]bool, bool)
- func (req *ServerHTTPRequest) GetQueryFloat64(key string) (float64, bool)
- func (req *ServerHTTPRequest) GetQueryFloat64List(key string) ([]float64, bool)
- func (req *ServerHTTPRequest) GetQueryFloat64Set(key string) ([]float64, bool)
- func (req *ServerHTTPRequest) GetQueryInt8(key string) (int8, bool)
- func (req *ServerHTTPRequest) GetQueryInt8List(key string) ([]int8, bool)
- func (req *ServerHTTPRequest) GetQueryInt8Set(key string) ([]int8, bool)
- func (req *ServerHTTPRequest) GetQueryInt16(key string) (int16, bool)
- func (req *ServerHTTPRequest) GetQueryInt16List(key string) ([]int16, bool)
- func (req *ServerHTTPRequest) GetQueryInt16Set(key string) ([]int16, bool)
- func (req *ServerHTTPRequest) GetQueryInt32(key string) (int32, bool)
- func (req *ServerHTTPRequest) GetQueryInt32List(key string) ([]int32, bool)
- func (req *ServerHTTPRequest) GetQueryInt32Set(key string) ([]int32, bool)
- func (req *ServerHTTPRequest) GetQueryInt64(key string) (int64, bool)
- func (req *ServerHTTPRequest) GetQueryInt64List(key string) ([]int64, bool)
- func (req *ServerHTTPRequest) GetQueryInt64Set(key string) ([]int64, bool)
- func (req *ServerHTTPRequest) GetQueryValue(key string) (string, bool)
- func (req *ServerHTTPRequest) GetQueryValueList(key string) ([]string, bool)
- func (req *ServerHTTPRequest) GetQueryValueSet(key string) ([]string, bool)
- func (req *ServerHTTPRequest) GetQueryValues(key string) ([]string, bool)
- func (req *ServerHTTPRequest) GetRawBody() []byte
- func (req *ServerHTTPRequest) GetSpan() opentracing.Span
- func (req *ServerHTTPRequest) HasQueryPrefix(prefix string) bool
- func (req *ServerHTTPRequest) HasQueryValue(key string) bool
- func (req *ServerHTTPRequest) LogAndSendQueryError(err error, expected, key, value string)
- func (req *ServerHTTPRequest) PeekBody(keys ...string) ([]byte, jsonparser.ValueType, error)
- func (req *ServerHTTPRequest) ReadAll() ([]byte, bool)
- func (req *ServerHTTPRequest) ReadAndUnmarshalBody(body interface{}) bool
- func (req *ServerHTTPRequest) ReplaceBody(body []byte)
- func (req *ServerHTTPRequest) SetQueryValue(key string, value string)
- func (req *ServerHTTPRequest) StartTime() time.Time
- func (req *ServerHTTPRequest) UnmarshalBody(body interface{}, rawBody []byte) bool
- type ServerHTTPResponse
- func (res *ServerHTTPResponse) GetPendingResponse() ([]byte, int)
- func (res *ServerHTTPResponse) GetPendingResponseObject() interface{}
- func (res *ServerHTTPResponse) Headers() http.Header
- func (res *ServerHTTPResponse) MarshalResponseJSON(body interface{}) []byte
- func (res *ServerHTTPResponse) PeekBody(keys ...string) ([]byte, jsonparser.ValueType, error)
- func (res *ServerHTTPResponse) SendError(statusCode int, errMsg string, errCause error)
- func (res *ServerHTTPResponse) SendErrorString(statusCode int, errMsg string)
- func (res *ServerHTTPResponse) SendResponse(statusCode int, headers Header, body interface{}, bytes []byte)
- func (res *ServerHTTPResponse) WriteBytes(statusCode int, headers Header, bytes []byte)
- func (res *ServerHTTPResponse) WriteJSON(statusCode int, headers Header, body interface{})
- func (res *ServerHTTPResponse) WriteJSONBytes(statusCode int, headers Header, bytes []byte)
- type ServerTChannelHeader
- func (th ServerTChannelHeader) Add(key string, value string)
- func (th ServerTChannelHeader) Ensure(keys []string, logger *zap.Logger) errordeprecated
- func (th ServerTChannelHeader) EnsureContext(ctx context.Context, keys []string, logger ContextLogger) error
- func (th ServerTChannelHeader) Get(key string) (string, bool)
- func (th ServerTChannelHeader) Keys() []string
- func (th ServerTChannelHeader) Set(key string, value string)
- func (th ServerTChannelHeader) Unset(key string)
- func (th ServerTChannelHeader) Values(key string) ([]string, bool)
- type SharedState
- type StaticConfig
- func (conf *StaticConfig) AsYaml() ([]byte, error)
- func (conf *StaticConfig) ContainsKey(key string) bool
- func (conf *StaticConfig) Destroy()
- func (conf *StaticConfig) Freeze()
- func (conf *StaticConfig) InspectOrDie() map[string]interface{}
- func (conf *StaticConfig) MustGetBoolean(key string) bool
- func (conf *StaticConfig) MustGetFloat(key string) float64
- func (conf *StaticConfig) MustGetInt(key string) int64
- func (conf *StaticConfig) MustGetString(key string) string
- func (conf *StaticConfig) MustGetStruct(key string, ptr interface{})
- func (conf *StaticConfig) SetConfigValueOrDie(key string, bytes []byte, dataType string)
- func (conf *StaticConfig) SetSeedOrDie(key string, value interface{})
- type TChannelCaller
- type TChannelClient
- type TChannelClientOption
- type TChannelEndpoint
- type TChannelHandler
- type TChannelLogger
- func (l TChannelLogger) Debug(msg string)
- func (l TChannelLogger) Debugf(msg string, args ...interface{})
- func (l TChannelLogger) Enabled(tlevel tchannel.LogLevel) bool
- func (l TChannelLogger) Error(msg string)
- func (l TChannelLogger) Fatal(msg string)
- func (l TChannelLogger) Fields() tchannel.LogFields
- func (l TChannelLogger) Info(msg string)
- func (l TChannelLogger) Infof(msg string, args ...interface{})
- func (l TChannelLogger) Warn(msg string)
- func (l TChannelLogger) WithFields(fields ...tchannel.LogField) tchannel.Logger
- type TChannelRouter
- type TchannelSharedState
- type UnexpectedHTTPError
Constants ¶
const ( // MetricEndpointPanics is endpoint level panic counter MetricEndpointPanics = "endpoint.panic" // MetricEndpointAppErrors is the metric name for endpoint level application error for TChannel MetricEndpointAppErrors = "endpoint.app-errors" // TraceIDKey is the log field key containing the associated trace id TraceIDKey = "trace.traceId" // TraceSpanKey is the log field key containing the associated span id TraceSpanKey = "trace.span" // TraceSampledKey is the log field key for whether a trace was sampled or not TraceSampledKey = "trace.sampled" // ClientResponseDurationKey is the key denoting a downstream response duration ClientResponseDurationKey = "client.response.duration" // ClientTypeKey denotes the type of the client, usually http / tchannel / client-less / custom ClientTypeKey = "client.type" )
Variables ¶
This section is empty.
Functions ¶
func EnsureEmpty ¶
EnsureEmpty ensures that the specified reader is empty. If the reader is not empty, it returns an error with the specified stage in the message.
func GetAPIEnvironment ¶ added in v1.1.0
func GetAPIEnvironment(endpoint *RouterEndpoint, r *http.Request) string
GetAPIEnvironment returns the api environment for a given request. By default, the api environment is set to production. However, there may be use cases where a different environment may be required for monitoring purposes. This may be overridden by a non-empty environment value in the request header.
func GetCtxLogCounterFromCtx ¶ added in v1.1.0
GetCtxLogCounterFromCtx returns ctxLogCounter value from ctx
func GetCtxLogLevelOrDebugLevelFromCtx ¶ added in v1.1.0
GetCtxLogLevelOrDebugLevelFromCtx returns ctxLogLevel value from ctx
func GetDirnameFromRuntimeCaller ¶
GetDirnameFromRuntimeCaller will compute the current dirname if passed a filename from runtime.Caller(0). This is useful for doing __dirname/__FILE__ for golang.
func GetEndpointRequestHeadersFromCtx ¶ added in v0.2.0
GetEndpointRequestHeadersFromCtx returns the endpoint request headers, if it exists on context
func GetLogFieldsFromCtx ¶ added in v0.3.0
GetLogFieldsFromCtx returns the log fields attached to the context.Context
func GetRequestEndpointFromCtx ¶
GetRequestEndpointFromCtx returns the endpoint, if it exists on context
func GetRoutingDelegateFromCtx ¶
GetRoutingDelegateFromCtx returns the tchannel routing delegate info extracted from context.
func GetScopeTagsFromCtx ¶ added in v0.2.0
GetScopeTagsFromCtx returns the tag info extracted from context.
func GetShardKeyFromCtx ¶ added in v0.4.3
GetShardKeyFromCtx returns the tchannel shardkey info extracted from context.
func LogErrorWarnTimeout
deprecated
LogErrorWarnTimeout logs warnings for timeout errors, otherwise logs errors TODO: We want to improve the classification of errors, similar to: https://github.com/uber/tchannel-node/blob/master/errors.js#L907-L930
Deprecated: use proper level to log instead
func NewTChannelLogger ¶
NewTChannelLogger creates a TChannel logger given a zap logger
func NewTChannelStatsReporter ¶
func NewTChannelStatsReporter(scope tally.Scope) tchannel.StatsReporter
NewTChannelStatsReporter returns a StatsReporter using the given tally.Scope.
func ParamsFromContext ¶ added in v0.2.0
ParamsFromContext extracts the URL parameters that are embedded in the context by the Zanzibar HTTP router implementation.
func ReadHeaders ¶
ReadHeaders reads key-value pairs encoded using WriteHeaders.
func ReadStruct ¶
ReadStruct reads the given Thriftrw struct.
func RequestUUIDFromCtx ¶ added in v0.3.0
RequestUUIDFromCtx returns the RequestUUID, if it exists on context
func WithEndpointField ¶
WithEndpointField adds the endpoint information in the request context.
func WithEndpointRequestHeadersField ¶ added in v0.2.0
func WithEndpointRequestHeadersField(ctx context.Context, requestHeaders map[string]string) context.Context
WithEndpointRequestHeadersField adds the endpoint request header information in the request context.
func WithLogFields ¶ added in v0.1.2
WithLogFields returns a new context with the given log fields attached to context.Context
func WithRoutingDelegate ¶
WithRoutingDelegate adds the tchannel routing delegate information in the request context.
func WithScopeTags ¶ added in v0.2.0
WithScopeTags returns a new context with the given scope tags attached to context.Context
func WithShardKey ¶ added in v0.4.3
WithShardKey adds the tchannel shard key information in the request context.
Types ¶
type ClientHTTPRequest ¶
type ClientHTTPRequest struct {
ClientID string
ClientTargetEndpoint string
MethodName string
Metrics ContextMetrics
Logger *zap.Logger
ContextLogger ContextLogger
// contains filtered or unexported fields
}
ClientHTTPRequest is the struct for making a single client request using an outbound http client.
func NewClientHTTPRequest ¶
func NewClientHTTPRequest( ctx context.Context, clientID string, clientMethod string, clientTargetEndpoint string, client *HTTPClient, ) *ClientHTTPRequest
NewClientHTTPRequest allocates a ClientHTTPRequest. The ctx parameter is the context associated with the outbound requests.
func (*ClientHTTPRequest) CheckHeaders ¶
func (req *ClientHTTPRequest) CheckHeaders(expected []string) error
CheckHeaders verifies that the outbound request contains required headers
func (*ClientHTTPRequest) Do ¶
func (req *ClientHTTPRequest) Do() (*ClientHTTPResponse, error)
Do will send the request out.
func (*ClientHTTPRequest) InjectSpanToHeader ¶
func (req *ClientHTTPRequest) InjectSpanToHeader(span opentracing.Span, format interface{}) error
InjectSpanToHeader will inject span to request header This method is current used for unit tests TODO: we need to set source and test code as same pkg name which would makes UTs easier
func (*ClientHTTPRequest) WriteBytes ¶ added in v0.4.5
func (req *ClientHTTPRequest) WriteBytes( method, url string, headers map[string]string, rawBody []byte, ) error
WriteBytes materialize the HTTP request with given method, url, headers and body. Body is assumed to be a byte array.s
type ClientHTTPResponse ¶
type ClientHTTPResponse struct {
StatusCode int
Duration time.Duration
Header http.Header
// contains filtered or unexported fields
}
ClientHTTPResponse is the struct managing the client response when making outbound http calls.
func NewClientHTTPResponse ¶
func NewClientHTTPResponse( req *ClientHTTPRequest, ) *ClientHTTPResponse
NewClientHTTPResponse allocates a client http response object to track http response.
func (*ClientHTTPResponse) CheckOKResponse ¶
func (res *ClientHTTPResponse) CheckOKResponse(okResponses []int)
CheckOKResponse checks if the status code is OK.
func (*ClientHTTPResponse) GetRawBody ¶
func (res *ClientHTTPResponse) GetRawBody() []byte
GetRawBody returns the body as byte array if it has been read.
func (*ClientHTTPResponse) ReadAll ¶
func (res *ClientHTTPResponse) ReadAll() ([]byte, error)
ReadAll reads bytes from response.
func (*ClientHTTPResponse) ReadAndUnmarshalBody ¶
func (res *ClientHTTPResponse) ReadAndUnmarshalBody(v interface{}) error
ReadAndUnmarshalBody will try to unmarshal non pointer value or fail
func (*ClientHTTPResponse) ReadAndUnmarshalBodyMultipleOptions ¶ added in v0.3.0
func (res *ClientHTTPResponse) ReadAndUnmarshalBodyMultipleOptions(vs []interface{}) (interface{}, error)
ReadAndUnmarshalBodyMultipleOptions will try to unmarshal non pointer value to one of the provided types or fail It will return the deserialized struct (if any) that succeeded
func (*ClientHTTPResponse) UnmarshalBody ¶ added in v0.4.5
func (res *ClientHTTPResponse) UnmarshalBody(v interface{}, rawBody []byte) error
UnmarshalBody helper to unmarshal body into struct
type ConfigOption ¶
type ConfigOption struct {
// contains filtered or unexported fields
}
ConfigOption points to a collection of bytes representing a file. This is either the full contents of the file as bytes, or a string poiting to a file
func ConfigFileContents ¶
func ConfigFileContents(fileBytes []byte) *ConfigOption
ConfigFileContents creates a ConfigFile representing the contents of the file
func ConfigFilePath ¶
func ConfigFilePath(path string) *ConfigOption
ConfigFilePath creates a ConfigFile represented as a path
type ContextExtractor ¶ added in v0.2.0
type ContextExtractor interface {
ExtractScopeTags(ctx context.Context) map[string]string
ExtractLogFields(ctx context.Context) []zap.Field
}
ContextExtractor is a extractor that extracts some log fields from the context
type ContextExtractors ¶ added in v0.2.0
type ContextExtractors struct {
ScopeTagsExtractors []ContextScopeTagsExtractor
LogFieldsExtractors []ContextLogFieldsExtractor
}
ContextExtractors warps extractors for context, implements ContextExtractor interface
func (*ContextExtractors) ExtractLogFields ¶ added in v0.2.0
func (c *ContextExtractors) ExtractLogFields(ctx context.Context) []zap.Field
ExtractLogFields extracts log fields from a context into a field.
func (*ContextExtractors) ExtractScopeTags ¶ added in v0.2.0
func (c *ContextExtractors) ExtractScopeTags(ctx context.Context) map[string]string
ExtractScopeTags extracts scope fields from a context into a tag.
type ContextLogFieldsExtractor ¶ added in v0.2.0
ContextLogFieldsExtractor defines func where extracts log fields from context
type ContextLogger ¶ added in v0.1.2
type ContextLogger interface {
Debug(ctx context.Context, msg string, fields ...zap.Field) context.Context
Error(ctx context.Context, msg string, fields ...zap.Field) context.Context
Info(ctx context.Context, msg string, fields ...zap.Field) context.Context
Panic(ctx context.Context, msg string, fields ...zap.Field) context.Context
Warn(ctx context.Context, msg string, fields ...zap.Field) context.Context
// DebugZ skips logs, and adds to context if skipZanzibarLogs is set to true otherwise behaves as normal Debug, similarly for other XxxxZ's
DebugZ(ctx context.Context, msg string, fields ...zap.Field) context.Context
ErrorZ(ctx context.Context, msg string, fields ...zap.Field) context.Context
InfoZ(ctx context.Context, msg string, fields ...zap.Field) context.Context
PanicZ(ctx context.Context, msg string, fields ...zap.Field) context.Context
WarnZ(ctx context.Context, msg string, fields ...zap.Field) context.Context
// Other utility methods on the logger
Check(lvl zapcore.Level, msg string) *zapcore.CheckedEntry
SetSkipZanzibarLogs(bool)
}
ContextLogger is a logger that extracts some log fields from the context before passing through to underlying zap logger. In cases it also updates the context instead of logging
func NewContextLogger ¶ added in v0.1.2
func NewContextLogger(log *zap.Logger) ContextLogger
NewContextLogger returns a logger that extracts log fields a context before passing through to underlying zap logger.
type ContextMetrics ¶ added in v0.2.0
type ContextMetrics interface {
IncCounter(ctx context.Context, name string, value int64)
RecordTimer(ctx context.Context, name string, d time.Duration)
RecordHistogramDuration(ctx context.Context, name string, d time.Duration)
}
ContextMetrics emit metrics with tags extracted from context.
func NewContextMetrics ¶ added in v0.2.0
func NewContextMetrics(scope tally.Scope) ContextMetrics
NewContextMetrics create ContextMetrics to emit metrics with tags extracted from context.
type ContextScopeTagsExtractor ¶ added in v0.2.0
ContextScopeTagsExtractor defines func where extracts tags from context
type DefaultDependencies ¶
type DefaultDependencies struct {
// ContextExtractor extracts context for scope and logs field
ContextExtractor ContextExtractor
// ContextLogger is a logger with request-scoped log fields
ContextLogger ContextLogger
// ContextMetrics emit metrics from context
ContextMetrics ContextMetrics
Logger *zap.Logger
Scope tally.Scope
Tracer opentracing.Tracer
Config *StaticConfig
ServerTChannel *tchannel.Channel
Gateway *Gateway
// dispatcher for managing gRPC clients
GRPCClientDispatcher *yarpc.Dispatcher
// JSONWrapper provides json marshaling and unmarshaling functionality
JSONWrapper jsonwrapper.JSONWrapper
}
DefaultDependencies are the common dependencies for all modules
type GRPCClientCallHelper ¶ added in v0.4.3
type GRPCClientCallHelper interface {
// Start method should be used just before calling the actual gRPC client method call.
Start()
// Finish method should be used right after the actual call to gRPC client method.
Finish(ctx context.Context, err error) context.Context
}
GRPCClientCallHelper is used to track internal state of logging and metrics.
func NewGRPCClientCallHelper ¶ added in v0.4.3
func NewGRPCClientCallHelper(ctx context.Context, serviceMethod string, opts *GRPCClientOpts) (context.Context, GRPCClientCallHelper)
NewGRPCClientCallHelper used to initialize a helper that will be used to track logging and metric for a gRPC Client call.
type GRPCClientOpts ¶ added in v0.4.3
type GRPCClientOpts struct {
ContextLogger ContextLogger
Metrics ContextMetrics
ContextExtractor ContextExtractor
RoutingKey string
RequestUUIDHeaderKey string
CircuitBreakerDisabled bool
Timeout time.Duration
ScopeTags map[string]map[string]string
}
GRPCClientOpts used to configure various client options.
func NewGRPCClientOpts ¶ added in v0.4.3
func NewGRPCClientOpts( contextLogger ContextLogger, metrics ContextMetrics, contextExtractor ContextExtractor, methodNames map[string]string, clientID, routingKey, requestUUIDHeaderKey string, circuitBreakerDisabled bool, timeoutInMS int, ) *GRPCClientOpts
NewGRPCClientOpts creates a new instance of GRPCClientOpts.
type Gateway ¶
type Gateway struct {
HTTPPort int32
TChannelPort int32
RealHTTPPort int32
RealHTTPAddr string
RealTChannelPort int32
RealTChannelAddr string
WaitGroup *sync.WaitGroup
ServerTChannel *tchannel.Channel
ClientTChannels map[string]*tchannel.Channel
ContextLogger ContextLogger
ContextMetrics ContextMetrics
ContextExtractor ContextExtractor
RootScope tally.Scope
Logger *zap.Logger
ServiceName string
Config *StaticConfig
HTTPRouter HTTPRouter
ServerTChannelRouter *TChannelRouter
TChannelSubLoggerLevel zapcore.Level
Tracer opentracing.Tracer
JSONWrapper jsonwrapper.JSONWrapper
// gRPC client dispatcher for gRPC client lifecycle management
GRPCClientDispatcher *yarpc.Dispatcher
// contains filtered or unexported fields
}
Gateway type
func CreateGateway ¶
func CreateGateway( config *StaticConfig, opts *Options, ) (*Gateway, error)
CreateGateway func