pb

package
v0.0.0-...-bc15ebc Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package pb provides utilities for working with protobuf messages.

Index

Constants

This section is empty.

Variables

View Source
var Compare = cmp.FilterValues(
	func(x, y interface{}) bool {
		_, xok := x.(proto.Message)
		_, yok := y.(proto.Message)
		return xok && yok
	},
	cmp.Comparer(func(x, y interface{}) bool {
		vx, ok := x.(proto.Message)
		if !ok {
			return false
		}
		vy, ok := y.(proto.Message)
		if !ok {
			return false
		}
		return proto.Equal(vx, vy)
	}),
)

Compare compares two proto messages.

Functions

func FromTime

func FromTime(from *timestamppb.Timestamp) time.Time

FromTime creates time.Time from pb Timestamp.

func ToTime

func ToTime(from time.Time) *timestamppb.Timestamp

ToTime creates pb Timestamp from time.Time.

Types

This section is empty.

Directories

Path Synopsis
Package proto provides the proto package.
Package proto provides the proto package.
Package types provides the types for the service.
Package types provides the types for the service.

Jump to

Keyboard shortcuts

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