internal

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TranslateLogEntry added in v0.94.0

func TranslateLogEntry(_ context.Context, _ *zap.Logger, data []byte) (pcommon.Resource, plog.LogRecord, error)

TranslateLogEntry translates a JSON-encoded LogEntry message into a pair of pcommon.Resource and plog.LogRecord, trying to keep as close as possible to the semantic conventions.

For maximum fidelity, the decoding is done according to the protobuf message schema; this ensures that a numeric value in the input is correctly translated to either an integer or a double in the output. It falls back to plain JSON decoding if payload type is not available in the proto registry.

Types

type StreamHandler

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

func NewHandler

func NewHandler(
	ctx context.Context,
	logger *zap.Logger,
	client *pubsub.SubscriberClient,
	clientID string,
	subscription string,
	callback func(ctx context.Context, message *pubsubpb.ReceivedMessage) error) (*StreamHandler, error)

func (*StreamHandler) CancelNow

func (handler *StreamHandler) CancelNow()

func (*StreamHandler) RecoverableStream

func (handler *StreamHandler) RecoverableStream(ctx context.Context)

func (*StreamHandler) Wait

func (handler *StreamHandler) Wait()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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