grpc

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StreamServerInterceptor

func StreamServerInterceptor(duck *duckbug.Duck, options ...Option) grpc.StreamServerInterceptor

func UnaryServerInterceptor

func UnaryServerInterceptor(duck *duckbug.Duck, options ...Option) grpc.UnaryServerInterceptor

Types

type Config

type Config struct {
	CapturePanics         bool
	Repanic               bool
	CaptureMetadata       bool
	CaptureTransactions   bool
	TransactionSampleRate float64
	IgnoredMethods        []string
	IgnoredMethodPrefixes []string
	SkipMethod            func(fullMethod string) bool
	// ShouldCapture decides whether an RPC that finished with the given code is
	// reported as an error. When nil, server-fault codes are captured.
	ShouldCapture func(code codes.Code) bool
}

type Option

type Option func(*Config)

func WithCaptureMetadata

func WithCaptureMetadata(enabled bool) Option

func WithCapturePanics

func WithCapturePanics(enabled bool) Option

func WithCaptureTransactions

func WithCaptureTransactions(enabled bool) Option

func WithIgnoredMethodPrefixes

func WithIgnoredMethodPrefixes(prefixes ...string) Option

func WithIgnoredMethods

func WithIgnoredMethods(methods ...string) Option

func WithProductionDefaults

func WithProductionDefaults() Option

WithProductionDefaults enables the most common gRPC server production setup: panic capture, metadata capture, and transaction capture with conservative sampling.

func WithRepanic

func WithRepanic(enabled bool) Option

func WithShouldCapture

func WithShouldCapture(fn func(code codes.Code) bool) Option

func WithSkipMethod

func WithSkipMethod(fn func(fullMethod string) bool) Option

func WithTransactionSampleRate

func WithTransactionSampleRate(rate float64) Option

Jump to

Keyboard shortcuts

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