omerror

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProtoFromErr

func ProtoFromErr(err error) *spb.Status

ProtoFromErr converts an error into a grpc status. It differs from google.golang.org/grpc/status in that it will return an OK code on nil, and returns the proper codes for context cancelation and deadline exceeded.

Types

type WaitFunc

type WaitFunc func() error

WaitFunc will wait until all called functions return. WaitFunc returns the first error returned, otherwise it returns nil.

func WaitOnErrors

func WaitOnErrors(logger *logrus.Entry, fs ...func() error) WaitFunc

WaitOnErrors immediately starts a new go routine for each function passed it. It returns a WaitFunc. Any additional errors not returned are instead logged.

Jump to

Keyboard shortcuts

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