protofilter

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToMap

func ToMap[T proto.Message](protoFilter T, opts ...ToMapOption) (map[string]any, error)

ToMap converts a proto filter message to a map with proper transformations. It applies default transformations (enum conversion, capitalization) and any custom transforms. By default, complexity is checked against filter.DefaultLimits.

Types

type ToMapOption

type ToMapOption func(*toMapOptions)

func WithComplexityLimits added in v0.9.0

func WithComplexityLimits(limits *filter.ComplexityLimits) ToMapOption

WithComplexityLimits sets custom complexity limits for the filter. By default, filter.DefaultLimits is used. Pass nil to disable complexity checking.

func WithTransformHook added in v0.9.0

func WithTransformHook(hook func(filter.TransformFunc) filter.TransformFunc) ToMapOption

WithTransformHook allows customizing the transform function

Jump to

Keyboard shortcuts

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