pbutils

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package pbutils provides helper utilities for working with protobuf objects. These utilities are mostly aimed at testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuzzFuncs

func FuzzFuncs() []interface{}

FuzzFuncs returns custom fuzzing functions set.

func FuzzUnmarshaler

func FuzzUnmarshaler(unmarshaler proto.Unmarshaler)

FuzzUnmarshaler tests given unmarshaler with random bytes.

func RoundTrip

func RoundTrip(
	marshaler proto.Marshaler,
	unmarshaler proto.Unmarshaler,
) error

RoundTrip takes a marshaler and unmarshaler, marshals the marshaler, and then unmarshals the result into the unmarshaler. If either procedure errors out, it returns an error; otherwise it returns nil and the unmarshaler is left with the results of the round-trip.

This is a utility meant to facilitate tests that verify round-trip marshaling of objects with custom protobuf marshaling.

Types

This section is empty.

Jump to

Keyboard shortcuts

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