fromgrpc

package
v0.0.0-...-d280c18 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnexpectedNilEntry  = errors.New("unexpected nil entry")
	ErrUnexpectedNilStatus = errors.New("unexpected nil status")
)

Errors that are specific to converting gRPC entries to Go.

Functions

func EntryPtr

func EntryPtr(entry *dinkurapiv1.Entry) (*dinkur.Entry, error)

EntryPtr converts a gRPC entry to a Go entry.

func EntryPtrNoNil

func EntryPtrNoNil(entry *dinkurapiv1.Entry) (dinkur.Entry, error)

EntryPtrNoNil converts a gRPC entry to a Go entry, or error if nil.

func EntrySlice

func EntrySlice(slice []*dinkurapiv1.Entry) ([]dinkur.Entry, error)

EntrySlice converts a slice of gRPC entries to Go entries. Nils are skipped.

func Event

Event converts a gRPC event to a Go event.

func Shorthand

Shorthand converts a gRPC shorthand to a timeutil shorthand.

func StatusPtrNoNil

func StatusPtrNoNil(status *dinkurapiv1.Status) (dinkur.Status, error)

StatusPtrNoNil converts a gRPC status to a dinkur status, or error on nil.

func TimeOrNow

func TimeOrNow(ts *timestamppb.Timestamp) time.Time

TimeOrNow converts gRPC timestamp to Go time, or time.Now() if nil.

func TimeOrZero

func TimeOrZero(ts *timestamppb.Timestamp) time.Time

TimeOrZero converts gRPC timestamp to Go time, or zero if nil.

func TimePtr

func TimePtr(ts *timestamppb.Timestamp) *time.Time

TimePtr converts gRPC timestamp to Go time pointer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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