xray

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 45 Imported by: 329

Documentation

Index

Constants

View Source
const ExtendedRequestIDKey string = "id_2"

ExtendedRequestIDKey is the key name of the extend request id.

View Source
const Header = `{"format": "json", "version": 1}` + "\n"

Header is added before sending segments to daemon.

View Source
const LambdaTaskRootKey string = "LAMBDA_TASK_ROOT"

LambdaTaskRootKey is the key to get Lambda Task Root from environment variable.

View Source
const LambdaTraceHeaderKey string = "x-amzn-trace-id"

LambdaTraceHeaderKey is key to get trace header from context.

View Source
const RequestIDKey string = "request_id"

RequestIDKey is the key name of the request id.

View Source
const S3ExtendedRequestIDHeaderKey string = "x-amz-id-2"

S3ExtendedRequestIDHeaderKey is the key name of the s3 extend request id.

View Source
const SDKInitializedFileFolder string = "/tmp/.aws-xray"

SDKInitializedFileFolder records the location of SDK initialized file.

View Source
const SDKInitializedFileName string = "initialized"

SDKInitializedFileName records the SDK initialized file name.

View Source
const SDKType = "X-Ray for Go"

SDKType records which X-Ray SDK customer uses.

View Source
const SDKVersion = "1.8.4"

SDKVersion records the current X-Ray Go SDK version.

View Source
const TraceIDHeaderKey = "x-amzn-trace-id"

TraceIDHeaderKey is the HTTP header name used for tracing.

Variables

View Source
var ContextKey = new(ContextKeytype)

ContextKey returns a pointer to a newly allocated zero value of ContextKeytype.

View Source
var ErrRetrieveSegment = errors.New("unable to retrieve segment")

ErrRetrieveSegment happens when a segment cannot be retrieved

Functions

func AWS

func AWS(c *client.Client)

AWS adds X-Ray tracing to an AWS client.

func AWSSession added in v1.0.0

func AWSSession(s *session.Session) *session.Session

AWSSession adds X-Ray tracing to an AWS session. Clients created under this session will inherit X-Ray tracing.

func AWSSessionWithWhitelist added in v1.0.0

func AWSSessionWithWhitelist(s *session.Session, filename string) *session.Session

AWSSessionWithWhitelist allows a custom parameter whitelist JSON file to be defined.

func AWSWithWhitelist

func AWSWithWhitelist(c *client.Client, filename string)

AWSWithWhitelist allows a custom parameter whitelist JSON file to be defined.

func AddAnnotation

func AddAnnotation(ctx context.Context, key string, value interface{}) error

AddAnnotation adds an annotation to the provided segment or subsegment in ctx.

func AddError

func AddError(ctx context.Context, err error) error

AddError adds an error to the provided segment or subsegment in ctx.

func AddMetadata

func AddMetadata(ctx context.Context, key string, value interface{}) error

AddMetadata adds a metadata to the provided segment or subsegment in ctx.

func AddMetadataToNamespace

func AddMetadataToNamespace(ctx context.Context, namespace string, key string, value interface{}) error

AddMetadataToNamespace adds a namespace to the provided segment's or subsegment's metadata in ctx.

func Capture

func Capture(ctx context.Context, name string, fn func(context.Context) error) (err error)

Capture traces the provided synchronous function by beginning and closing a subsegment around its execution.

func CaptureAsync

func CaptureAsync(ctx context.Context, name string, fn func(context.Context) error)

CaptureAsync traces an arbitrary code segment within a goroutine. Use CaptureAsync instead of manually calling Capture within a goroutine to ensure the segment is flushed properly.

func Client

func Client(c *http.Client) *http.Client

Client creates a shallow copy of the provided http client, defaulting to http.DefaultClient, with roundtripper wrapped with xray.RoundTripper.

func Configure

func Configure(c Config) error

Configure overrides default configuration options with customer-defined values.

func ContextWithConfig added in v1.0.0

func ContextWithConfig(ctx context.Context, c Config) (context.Context, error)

ContextWithConfig returns context with given configuration settings.

func DetachContext

func DetachContext(ctx context.Context) context.Context

DetachContext returns a new context with the existing segment. This is useful for creating background tasks which won't be cancelled when a request completes.

func Handler

func Handler(sn SegmentNamer, h http.Handler) http.Handler

Handler wraps the provided http handler with xray.Capture using the request's context, parsing the incoming headers, adding response headers if needed, and sets HTTP specific trace fields. Handler names the generated segments using the provided SegmentNamer.

func HandlerWithContext added in v1.0.0

func HandlerWithContext(ctx context.Context, sn SegmentNamer, h http.Handler) http.Handler

HandlerWithContext wraps the provided http handler and context to parse the incoming headers, add response headers if needed, and sets HTTP specific trace fields. HandlerWithContext names the generated segments using the provided SegmentNamer.

func HttpCaptureResponse added in v1.6.0

func HttpCaptureResponse(seg *Segment, statusCode int)

HttpCaptureResponse fill response by http status code

func HttpTrace added in v1.7.0

func HttpTrace(seg *Segment, h http.Handler, w http.ResponseWriter, r *http.Request, traceHeader *header.Header)

func NewSegmentID

func NewSegmentID() string

NewSegmentID generates a string format of segment ID.

func NewTraceID

func NewTraceID() string

NewTraceID generates a string format of random trace ID.

func RequestWasTraced

func RequestWasTraced(ctx context.Context) bool

RequestWasTraced returns true if the context contains an X-Ray segment that was created from an HTTP request that contained a trace header. This is useful to ensure that a service is only called from X-Ray traced services.

func RoundTripper

func RoundTripper(rt http.RoundTripper) http.RoundTripper

RoundTripper wraps the provided http roundtripper with xray.Capture, sets HTTP-specific xray fields, and adds the trace header to the outbound request.

func SQLConnector added in v1.0.0

func SQLConnector(dsn string, connector driver.Connector) driver.Connector

SQLConnector wraps the connector, and traces SQL executions. Unlike SQLContext, SQLConnector doesn't filter the password of the dsn. So, you have to filter the password before passing the dsn to SQLConnector.

func SQLContext added in v1.0.0

func SQLContext(driver, dsn string) (*sql.DB, error)

SQLContext opens a normalized and traced wrapper around an *sql.DB connection. It uses `sql.Open` internally and shares the same function signature. To ensure passwords are filtered, it is HIGHLY RECOMMENDED that your DSN follows the format: `<schema>://<user>:<password>@<host>:<port>/<database>`

func SdkDisabled added in v1.1.0

func SdkDisabled() bool

Check if SDK is disabled

func SetLogger added in v1.0.0

func SetLogger(l xraylog.Logger)

SetLogger sets the logger instance used by xray. Only set from init() functions as SetLogger is not goroutine safe.

func TraceID

func TraceID(ctx context.Context) string

TraceID returns the canonical ID of the cross-service trace from the given segment in ctx. The value can be used in X-Ray's UI to uniquely identify the code paths executed. If no segment is provided in ctx, an empty string is returned.

func UnaryClientInterceptor added in v1.5.0

func UnaryClientInterceptor(clientInterceptorOptions ...GrpcOption) grpc.UnaryClientInterceptor

UnaryClientInterceptor provides gRPC unary client interceptor.

func UnaryServerInterceptor added in v1.5.0

func UnaryServerInterceptor(serverInterceptorOptions ...GrpcOption) grpc.UnaryServerInterceptor

UnaryServerInterceptor provides gRPC unary server interceptor.

Types

type CauseData

type CauseData struct {
	WorkingDirectory string                `json:"working_directory,omitempty"`
	Paths            []string              `json:"paths,omitempty"`
	Exceptions       []exception.Exception `json:"exceptions,omitempty"`
}

CauseData provides the shape for unmarshalling data that records exception.

type ClientTrace

type ClientTrace struct {
	// contains filtered or unexported fields
}

ClientTrace is a set of pointers of HTTPSubsegments and ClientTrace.

func NewClientTrace

func NewClientTrace(opCtx context.Context) (ct *ClientTrace, err error)

NewClientTrace returns an instance of xray.ClientTrace, a wrapper around httptrace.ClientTrace. The ClientTrace implementation will generate subsegments for connection time, DNS lookup time, TLS handshake time, and provides additional information about the HTTP round trip

type Config

type Config struct {
	DaemonAddr                  string
	ServiceVersion              string
	Emitter                     Emitter
	SamplingStrategy            sampling.Strategy
	StreamingStrategy           StreamingStrategy
	ExceptionFormattingStrategy exception.FormattingStrategy
	ContextMissingStrategy      ctxmissing.Strategy

	// LogLevel and LogFormat are deprecated and no longer have any effect.
	// See SetLogger() and the associated xraylog.Logger interface to control
	// logging.
	LogLevel  string
	LogFormat string
}

Config is a set of X-Ray configurations.

func GetRecorder added in v1.0.0

func GetRecorder(ctx context.Context) *Config

GetRecorder returns a pointer to the config struct provided in ctx, or nil if no config is set.

type ContextKeytype

type ContextKeytype int

ContextKeytype defines integer to be type of ContextKey.

type DefaultEmitter added in v1.0.0

type DefaultEmitter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

DefaultEmitter provides the naive implementation of emitting trace entities.

func NewDefaultEmitter added in v1.0.0

func NewDefaultEmitter(raddr *net.UDPAddr) (*DefaultEmitter, error)

NewDefaultEmitter initializes and returns a pointer to an instance of DefaultEmitter.

func (*DefaultEmitter) Emit added in v1.0.0

func (de *DefaultEmitter) Emit(seg *Segment)

Emit segment or subsegment if root segment is sampled. seg has a write lock acquired by the caller.

func (*DefaultEmitter) RefreshEmitterWithAddress added in v1.0.0

func (de *DefaultEmitter) RefreshEmitterWithAddress(raddr *net.UDPAddr)

RefreshEmitterWithAddress dials UDP based on the input UDP address.

type DefaultStreamingStrategy

type DefaultStreamingStrategy struct {
	MaxSubsegmentCount uint32
}

DefaultStreamingStrategy provides a default value of 20 for the maximum number of subsegments that can be emitted in a single UDP packet.

func NewDefaultStreamingStrategy

func NewDefaultStreamingStrategy() (*DefaultStreamingStrategy, error)

NewDefaultStreamingStrategy initializes and returns a pointer to an instance of DefaultStreamingStrategy.

func NewDefaultStreamingStrategyWithMaxSubsegmentCount

func NewDefaultStreamingStrategyWithMaxSubsegmentCount(maxSubsegmentCount int) (*DefaultStreamingStrategy, error)

NewDefaultStreamingStrategyWithMaxSubsegmentCount initializes and returns a pointer to an instance of DefaultStreamingStrategy with a custom maximum number of subsegments per UDP packet.

func (*DefaultStreamingStrategy) RequiresStreaming

func (dSS *DefaultStreamingStrategy) RequiresStreaming(seg *Segment) bool

RequiresStreaming returns true when the number of subsegment children for a given segment is larger than MaxSubsegmentCount.

func (*DefaultStreamingStrategy) StreamCompletedSubsegments

func (dSS *DefaultStreamingStrategy) StreamCompletedSubsegments(seg *Segment) [][]byte

StreamCompletedSubsegments separates subsegments from the provided segment tree and sends them to daemon as streamed subsegment UDP packets.

type DynamicSegmentNamer

type DynamicSegmentNamer struct {
	FallbackName    string
	RecognizedHosts string
}

DynamicSegmentNamer chooses names for segments generated for incoming requests by parsing the HOST header of the incoming request. If the host header matches a given recognized pattern (using the included pattern package), it is used as the segment name. Otherwise, the fallback name is used.

func NewDynamicSegmentNamer

func NewDynamicSegmentNamer(fallback string, recognized string) *DynamicSegmentNamer

NewDynamicSegmentNamer creates a new dynamic segment namer.

func (*DynamicSegmentNamer) Name

func (dSN *DynamicSegmentNamer) Name(host string) string

Name returns the segment name for the given host header value.

type Emitter added in v1.0.0

type Emitter interface {
	Emit(seg *Segment)
	RefreshEmitterWithAddress(raddr *net.UDPAddr)
}

Emitter provides an interface for implementing emitting trace entities.

type FastHTTPHandler added in v1.5.0

type FastHTTPHandler interface {
	Handler(SegmentNamer, fasthttp.RequestHandler) fasthttp.RequestHandler
}

func NewFastHTTPInstrumentor added in v1.5.0

func NewFastHTTPInstrumentor(cfg *Config) FastHTTPHandler

NewFastHTTPInstrumentor returns a struct that provides Handle method that satisfy fasthttp.RequestHandler interface.

type FixedSegmentNamer

type FixedSegmentNamer struct {
	FixedName string
}

FixedSegmentNamer records the fixed name of service node.

func NewFixedSegmentNamer

func NewFixedSegmentNamer(name string) *FixedSegmentNamer

NewFixedSegmentNamer initializes a FixedSegmentNamer which will provide a fixed segment name for every generated segment. If the AWS_XRAY_TRACING_NAME environment variable is set, its value will override the provided name argument.

func (*FixedSegmentNamer) Name

func (fSN *FixedSegmentNamer) Name(host string) string

Name returns the segment name for the given host header value. In this case, FixedName is always returned.

type GrpcOption added in v1.5.0

type GrpcOption interface {
	// contains filtered or unexported methods
}

func WithRecorder added in v1.5.0

func WithRecorder(cfg *Config) GrpcOption

WithRecorder configures the instrumentation by given xray.Config.

func WithSegmentNamer added in v1.5.0

func WithSegmentNamer(sn SegmentNamer) GrpcOption

WithSegmentNamer makes the interceptor use the segment namer to name the segment.

type HTTPData

type HTTPData struct {
	Request  *RequestData  `json:"request,omitempty"`
	Response *ResponseData `json:"response,omitempty"`
}

HTTPData provides the shape for unmarshalling request and response data.

func (*HTTPData) GetRequest

func (d *HTTPData) GetRequest() *RequestData

GetRequest returns value of RequestData.

func (*HTTPData) GetResponse

func (d *HTTPData) GetResponse() *ResponseData

GetResponse returns value of ResponseData.

type HTTPSubsegments added in v0.9.4

type HTTPSubsegments struct {
	// contains filtered or unexported fields
}

HTTPSubsegments is a set of context in different HTTP operation. Note: from ClientTrace godoc

Functions may be called concurrently from different goroutines

HTTPSubsegments must operate as though all functions on it can be called in different goroutines and must protect against races

func NewHTTPSubsegments added in v1.0.0

func NewHTTPSubsegments(opCtx context.Context) *HTTPSubsegments

NewHTTPSubsegments creates a new HTTPSubsegments to use in httptrace.ClientTrace functions

func (*HTTPSubsegments) ConnectDone added in v0.9.4

func (xt *HTTPSubsegments) ConnectDone(network, addr string, err error)

ConnectDone closes the dial subsegment if the HTTP operation subsegment is still in progress, passing the error value (if any). Information about the network over which the dial was made is added as metadata to the subsegment.

func (*HTTPSubsegments) ConnectStart added in v0.9.4

func (xt *HTTPSubsegments) ConnectStart(network, addr string)

ConnectStart begins a dial subsegment if the HTTP operation subsegment is still in progress.

func (*HTTPSubsegments) DNSDone added in v0.9.4

func (xt *HTTPSubsegments) DNSDone(info httptrace.DNSDoneInfo)

DNSDone closes the dns subsegment if the HTTP operation subsegment is still in progress, passing the error value (if any). Information about the address values looked up, and whether or not the call was coalesced is added as metadata to the dns subsegment.

func (*HTTPSubsegments) DNSStart added in v0.9.4

func (xt *HTTPSubsegments) DNSStart(info httptrace.DNSStartInfo)

DNSStart begins a dns subsegment if the HTTP operation subsegment is still in progress.

func (*HTTPSubsegments) GetConn added in v0.9.4

func (xt *HTTPSubsegments) GetConn(hostPort string)

GetConn begins a connect subsegment if the HTTP operation subsegment is still in progress.

func (*HTTPSubsegments) GotConn added in v0.9.4

func (xt *HTTPSubsegments) GotConn(info *httptrace.GotConnInfo, err error)

GotConn closes the connect subsegment if the HTTP operation subsegment is still in progress, passing the error value (if any). Information about the connection is added as metadata to the subsegment. If the connection is marked as reused, the connect subsegment is deleted.

func (*HTTPSubsegments) GotFirstResponseByte added in v0.9.4

func (xt *HTTPSubsegments) GotFirstResponseByte()

GotFirstResponseByte closes the response subsegment if the HTTP operation subsegment is still in progress.

func (*HTTPSubsegments) TLSHandshakeDone added in v0.9.4

func (xt *HTTPSubsegments) TLSHandshakeDone(connState tls.ConnectionState, err error)

TLSHandshakeDone closes the tls subsegment if the HTTP operation subsegment is still in progress, passing the error value(if any). Information about the tls connection is added as metadata to the subsegment.

func (*HTTPSubsegments) TLSHandshakeStart added in v0.9.4

func (xt *HTTPSubsegments) TLSHandshakeStart()

TLSHandshakeStart begins a tls subsegment if the HTTP operation subsegment is still in progress.

func (*HTTPSubsegments) WroteRequest added in v0.9.4

func (xt *HTTPSubsegments) WroteRequest(info httptrace.WroteRequestInfo)

WroteRequest closes the request subsegment if the HTTP operation subsegment is still in progress, passing the error value (if any). The response subsegment is then begun.

type RecorderContextKey added in v1.0.0

type RecorderContextKey struct{}

RecorderContextKey records the key for Config value.

type RequestData

type RequestData struct {
	Method        string `json:"method,omitempty"`
	URL           string `json:"url,omitempty"` // http(s)://host/path
	ClientIP      string `json:"client_ip,omitempty"`
	UserAgent     string `json:"user_agent,omitempty"`
	XForwardedFor bool   `json:"x_forwarded_for,omitempty"`
	Traced        bool   `json:"traced,omitempty"`
}

RequestData provides the shape for unmarshalling request data.

type ResponseData

type ResponseData struct {
	Status        int `json:"status,omitempty"`
	ContentLength int `json:"content_length,omitempty"`
}

ResponseData provides the shape for unmarshalling response data.

type SDK added in v1.0.0

type SDK struct {
	Version  string `json:"sdk_version,omitempty"`
	Type     string `json:"sdk,omitempty"`
	RuleName string `json:"sampling_rule_name,omitempty"`
}

SDK provides the shape for unmarshalling an SDK struct.

type SQLData

type SQLData struct {
	ConnectionString string `json:"connection_string,omitempty"`
	URL              string `json:"url,omitempty"` // host:port/database
	DatabaseType     string `json:"database_type,omitempty"`
	DatabaseVersion  string `json:"database_version,omitempty"`
	DriverVersion    string `json:"driver_version,omitempty"`
	User             string `json:"user,omitempty"`
	Preparation      string `json:"preparation,omitempty"` // "statement" / "call"
	SanitizedQuery   string `json:"sanitized_query,omitempty"`
}

SQLData provides the shape for unmarshalling sql data.

type Segment

type Segment struct {
	sync.RWMutex

	Sampled          bool           `json:"-"`
	RequestWasTraced bool           `json:"-"` // Used by xray.RequestWasTraced
	ContextDone      bool           `json:"-"`
	Emitted          bool           `json:"-"`
	IncomingHeader   *header.Header `json:"-"`
	ParentSegment    *Segment       `json:"-"` // The root of the Segment tree, the parent Segment (not Subsegment).

	// Required
	TraceID   string  `json:"trace_id,omitempty"`
	ID        string  `json:"id"`
	Name      string  `json:"name"`
	StartTime float64 `json:"start_time"`
	EndTime   float64 `json:"end_time,omitempty"`

	// Optional
	InProgress  bool       `json:"in_progress,omitempty"`
	ParentID    string     `json:"parent_id,omitempty"`
	Fault       bool       `json:"fault,omitempty"`
	Error       bool       `json:"error,omitempty"`
	Throttle    bool       `json:"throttle,omitempty"`
	Cause       *CauseData `json:"cause,omitempty"`
	ResourceARN string     `json:"resource_arn,omitempty"`
	Origin      string     `json:"origin,omitempty"`

	Type         string   `json:"type,omitempty"`
	Namespace    string   `json:"namespace,omitempty"`
	User         string   `json:"user,omitempty"`
	PrecursorIDs []string `json:"precursor_ids,omitempty"`

	HTTP *HTTPData              `json:"http,omitempty"`
	AWS  map[string]interface{} `json:"aws,omitempty"`

	Service *ServiceData `json:"service,omitempty"`

	// SQL
	SQL *SQLData `json:"sql,omitempty"`

	// Metadata
	Annotations map[string]interface{}            `json:"annotations,omitempty"`
	Metadata    map[string]map[string]interface{} `json:"metadata,omitempty"`

	// Children
	Subsegments []json.RawMessage `json:"subsegments,omitempty"`

	// Configuration
	Configuration *Config `json:"-"`

	// Lambda
	Facade bool `json:"-"`

	// Dummy Segment flag
	Dummy bool
	// contains filtered or unexported fields
}

Segment provides the resource's name, details about the request, and details about the work done.

func BeginFacadeSegment added in v1.0.0

func BeginFacadeSegment(ctx context.Context, name string, h *header.Header) (context.Context, *Segment)

BeginFacadeSegment creates a Segment for a given name and context. NOTE: This is an internal API only to be used in Lambda context within the SDK. Consider using BeginSegment instead.

func BeginSegment

func BeginSegment(ctx context.Context, name string) (context.Context, *Segment)

BeginSegment creates a Segment for a given name and context.

func BeginSegmentWithSampling added in v1.0.0

func BeginSegmentWithSampling(ctx context.Context, name string, r *http.Request, traceHeader *header.Header) (context.Context, *Segment)

func BeginSubsegment

func BeginSubsegment(ctx context.Context, name string) (context.Context, *Segment)

BeginSubsegment creates a subsegment for a given name and context.

func BeginSubsegmentWithoutSampling added in v1.8.0

func BeginSubsegmentWithoutSampling(ctx context.Context, name string) (context.Context, *Segment)

func GetSegment

func GetSegment(ctx context.Context) *Segment

GetSegment returns a pointer to the segment or subsegment provided in ctx, or nil if no segment or subsegment is found.

func NewSegmentFromHeader

func NewSegmentFromHeader(ctx context.Context, name string, r *http.Request, h *header.Header) (context.Context, *Segment)

NewSegmentFromHeader creates a segment for downstream call and add information to the segment that gets from HTTP header.

func (*Segment) AddAnnotation added in v0.9.4

func (seg *Segment) AddAnnotation(key string, value interface{}) error

AddAnnotation allows adding an annotation to the segment.

func (*Segment) AddError added in v0.9.4

func (seg *Segment) AddError(err error) error

AddError allows adding an error to the segment.

func (*Segment) AddMetadata added in v0.9.4

func (seg *Segment) AddMetadata(key string, value interface{}) error

AddMetadata allows adding metadata to the segment.

func (*Segment) AddMetadataToNamespace added in v0.9.4

func (seg *Segment) AddMetadataToNamespace(namespace string, key string, value interface{}) error

AddMetadataToNamespace allows adding a namespace into metadata for the segment.

func (*Segment) AddRuleName added in v1.0.0

func (s *Segment) AddRuleName(sd *sampling.Decision)

AddRuleName adds rule name, if present from sampling decision to xray context.

func (*Segment) Close

func (seg *Segment) Close(err error)

Close a segment.

func (*Segment) CloseAndStream added in v1.0.0

func (seg *Segment) CloseAndStream(err error)

CloseAndStream closes a subsegment and sends it.

func (*Segment) DownstreamHeader

func (s *Segment) DownstreamHeader() *header.Header

DownstreamHeader returns a header for passing to downstream calls.

func (*Segment) GetAWS

func (s *Segment) GetAWS() map[string]interface{}

GetAWS returns value of AWS.

func (*Segment) GetCause

func (s *Segment) GetCause() *CauseData

GetCause returns value of Cause.

func (*Segment) GetConfiguration added in v1.0.0

func (s *Segment) GetConfiguration() *Config

GetConfiguration returns a value of Config.

func (*Segment) GetHTTP

func (s *Segment) GetHTTP() *HTTPData

GetHTTP returns value of HTTP.

func (*Segment) GetSQL

func (s *Segment) GetSQL() *SQLData

GetSQL returns value of SQL.

func (*Segment) GetService

func (s *Segment) GetService() *ServiceData

GetService returns value of Service.

func (*Segment) RemoveSubsegment

func (seg *Segment) RemoveSubsegment(remove *Segment) bool

RemoveSubsegment removes a subsegment child from a segment or subsegment.

type SegmentNamer

type SegmentNamer interface {
	Name(host string) string
}

SegmentNamer is the interface for naming service node.

type ServiceData

type ServiceData struct {
	Version        string `json:"version,omitempty"`
	RuntimeVersion string `json:"runtime_version,omitempty"`
	Runtime        string `json:"runtime,omitempty"`
}

ServiceData provides the shape for unmarshalling service version.

type StreamingStrategy

type StreamingStrategy interface {
	RequiresStreaming(seg *Segment) bool
	StreamCompletedSubsegments(seg *Segment) [][]byte
}

StreamingStrategy provides an interface for implementing streaming strategies.

Jump to

Keyboard shortcuts

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