protoutil

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package protoutil provides helper functions for working with well-known protobuf types.

It aims to serve a purpose similar to packages topoproto and mysqlctlproto, but for general, common types, rather than types related to a particular Vitess RPC service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DurationFromProto

func DurationFromProto(dpb *vttime.Duration) (time.Duration, bool, error)

DurationFromProto converts a durationpb type to a time.Duration. It returns a three-tuple of (dgo, ok, err) where dgo is the go time.Duration, ok indicates whether the proto value was set, and err is set on failure to convert the proto value.

func DurationToProto

func DurationToProto(d time.Duration) *vttime.Duration

DurationToProto converts a time.Duration to a durpb.Duration.

func TimeFromProto added in v0.11.0

func TimeFromProto(tpb *vttime.Time) time.Time

TimeFromProto converts a vttime.Time proto message into a time.Time object.

func TimeToProto added in v0.11.0

func TimeToProto(t time.Time) *vttime.Time

TimeToProto converts a time.Time object into a vttime.Time proto mesasge.

Types

This section is empty.

Jump to

Keyboard shortcuts

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