binarylog

package
v1.67.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Overview

Package binarylog implementation binary logging as defined in https://github.com/grpc/proposal/blob/master/A16-binary-logging.md.

Notice: All APIs in this package are experimental.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetSink

func SetSink(s Sink)

SetSink sets the destination for the binary log entries.

NOTE: this function must only be called during initialization time (i.e. in an init() function), and is not thread-safe.

Types

type Sink

type Sink interface {
	// Write marshals the log entry and writes it to the destination. The format
	// is not specified, but should have sufficient information to rebuild the
	// entry. Some options are: proto bytes, or proto json.
	//
	// Note this function needs to be thread-safe.
	Write(*binlogpb.GrpcLogEntry) error
	// Close closes this sink and cleans up resources (e.g. the flushing
	// goroutine).
	Close() error
}

Sink represents the destination for the binary log entries.

func NewTempFileSink

func NewTempFileSink() (Sink, error)

NewTempFileSink creates a temp file and returns a Sink that writes to this file.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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